-
Notifications
You must be signed in to change notification settings - Fork 1
149 lines (118 loc) · 3.96 KB
/
main.yaml
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Build and release
on:
push:
branches:
- master
tags:
- v*
permissions:
contents: write
jobs:
build-linux:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
persist-credentials: false
- name: Setup Flutter
uses: subosito/flutter-action@v2.13.0
with:
flutter-version: "3.16.8"
channel: "stable"
cache: true
- name: Bootstrap
run: sudo apt-get update -y && sudo apt-get install -y ninja-build libgtk-3-dev
- name: Build
run: ./build.sh
- name: Move release
run: mkdir release; mv build/linux/x64/release/bundle "release/${{ github.event.repository.name }}"
- name: Package
run: tar -cf- -C release "${{ github.event.repository.name }}" | xz -c9e - > "${{ github.event.repository.name }}-linux.tar.xz"
- name: Save
uses: actions/upload-artifact@v4.3.1
with:
name: release-linux
path: "*.tar.xz"
build-macos:
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
persist-credentials: false
- name: Setup Flutter
uses: subosito/flutter-action@v2.13.0
with:
flutter-version: "3.16.8"
channel: "stable"
cache: true
- name: Build
run: ./build.sh
- name: Package
run: productbuild --component "build/macos/Build/Products/Release/${{ github.event.repository.name }}.app" /Applications/ ${{ github.event.repository.name }}-macos.pkg
- name: Save
uses: actions/upload-artifact@v4.3.1
with:
name: release-macos
path: "*.pkg"
build-windows:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
persist-credentials: false
- name: Setup Flutter
uses: subosito/flutter-action@v2.13.0
with:
flutter-version: "3.16.8"
channel: "stable"
cache: true
- name: Build
run: .\build-windows.ps1
- name: Move release folder
run: mkdir release; mv build\windows\x64\runner\Release "release\${{ github.event.repository.name }}"
- name: Archive
run: Compress-Archive -Path "release\${{ github.event.repository.name }}" -DestinationPath "${{ github.event.repository.name }}-windows.zip"
- name: Save
uses: actions/upload-artifact@v4.3.1
with:
name: release-windows
path: "*.zip"
release:
if: startsWith(github.ref, 'refs/tags/')
needs:
- build-linux
- build-macos
- build-windows
runs-on: ubuntu-22.04
steps:
- name: Version
id: version
run: echo "version=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v4.1.1
with:
persist-credentials: false
- name: Notes
run: grep -Pzom1 "(?s)\n[##\s]*${{ steps.version.outputs.version }}.*?\n+.*?\K.*?(\n\n|$)" CHANGELOG.md | sed 's/[^[:print:]]//g' > RELEASE.md
- name: Download
uses: actions/download-artifact@v4.1.4
with:
path: artifacts
- name: Rename
run: |
mv artifacts/release-linux/${{ github.event.repository.name }}-linux.tar.xz artifacts/release-linux/${{ github.event.repository.name }}-linux-${{ steps.version.outputs.version }}.tar.xz
mv artifacts/release-macos/${{ github.event.repository.name }}-macos.pkg artifacts/release-macos/${{ github.event.repository.name }}-macos-${{ steps.version.outputs.version }}.pkg
mv artifacts/release-windows/${{ github.event.repository.name }}-windows.zip artifacts/release-windows/${{ github.event.repository.name }}-windows-${{ steps.version.outputs.version }}.zip
- name: Release
uses: softprops/action-gh-release@v2.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
artifacts/release-linux/*.tar.xz
artifacts/release-macos/*.pkg
artifacts/release-windows/*.zip
body_path: RELEASE.md