Repository navigation
106 lines (88 loc) · 3.43 KB
/
Copy pathrelease.yml
File metadata and controls
106 lines (88 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Desktop Release
on:
push:
branches: [master]
permissions:
contents: read
jobs:
build-windows:
name: Build Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # actions/checkout@v4.2.2
with:
persist-credentials: false
- uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # subosito/flutter-action@v2
with:
flutter-version: '3.44.2'
channel: stable
cache: true
- run: flutter pub get
- run: dart run build_runner build --delete-conflicting-outputs
- run: flutter build windows --release
- name: Zip Windows build
shell: pwsh
run: Compress-Archive -Path "build\windows\x64\runner\Release\*" -DestinationPath BMS-windows.zip
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # actions/upload-artifact@v7.0.1
with:
name: windows-build
path: BMS-windows.zip
retention-days: 1
build-macos:
name: Build macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # actions/checkout@v4.2.2
with:
persist-credentials: false
- uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # subosito/flutter-action@v2
with:
flutter-version: '3.44.2'
channel: stable
cache: true
- run: flutter pub get
- run: dart run build_runner build --delete-conflicting-outputs
- run: flutter build macos --release
- name: Ad-hoc sign
run: |
APP=$(find build/macos/Build/Products/Release -name "*.app" -maxdepth 1 | head -1)
codesign --force --deep --sign - "$APP"
- name: Zip macOS app
run: |
APP=$(find build/macos/Build/Products/Release -name "*.app" -maxdepth 1 | head -1)
ditto -c -k --keepParent "$APP" BMS-macos.zip
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # actions/upload-artifact@v7.0.1
with:
name: macos-build
path: BMS-macos.zip
retention-days: 1
release:
name: Create Release
needs: [build-windows, build-macos]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Generate timestamp tag
id: tag
run: echo "name=build-$(date -u +%Y%m%d-%H%M%S)" >> "$GITHUB_OUTPUT"
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # actions/download-artifact@v8.0.1
with:
name: windows-build
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # actions/download-artifact@v8.0.1
with:
name: macos-build
- name: Rename artifacts with tag
run: |
mv BMS-windows.zip "BMS-windows-${{ steps.tag.outputs.name }}.zip"
mv BMS-macos.zip "BMS-macos-${{ steps.tag.outputs.name }}.zip"
- uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # softprops/action-gh-release@v3.0.2
with:
tag_name: ${{ steps.tag.outputs.name }}
name: ${{ steps.tag.outputs.name }}
prerelease: true
generate_release_notes: true
target_commitish: ${{ github.sha }}
files: |
BMS-windows-${{ steps.tag.outputs.name }}.zip
BMS-macos-${{ steps.tag.outputs.name }}.zip