@@ -2,69 +2,177 @@ name: Release
22
33on :
44 workflow_dispatch :
5+ inputs :
6+ version :
7+ type : string
8+ description : Version (Semver without leading v)
9+ sentry-release :
10+ type : boolean
11+ description : Make Sentry Release?
12+ default : false
13+
514 release :
615 types : [ published ]
716
817jobs :
9- release :
10- if : github.repository == 'ionite34/StabilityMatrix'
11- runs-on : windows-latest
12-
18+ release-linux :
19+ if : github.repository == 'ionite34/StabilityMatrix' || github.event_name == 'workflow_dispatch'
20+ name : Release (linux-x64)
21+ env :
22+ platform-id : linux-x64
23+ out-name : StabilityMatrix.AppImage
24+ runs-on : ubuntu-latest
1325 steps :
1426 - uses : actions/checkout@v3
1527
1628 - uses : olegtarasov/get-tag@v2.1.2
29+ if : github.event_name == 'release'
1730 id : tag_name
1831 with :
1932 tagRegex : " v(.*)"
20-
21- - name : Set Tag
33+
34+ - name : Set Version from Tag
35+ if : github.event_name == 'release'
2236 run : |
2337 echo "Using tag ${{ env.GIT_TAG_NAME }}"
24- echo "RELEASE_VERSION=${{ env.GIT_TAG_NAME }}.0" >> $env:GITHUB_ENV
38+ echo "RELEASE_VERSION=${{ env.GIT_TAG_NAME }}" >> $GITHUB_ENV
39+
40+ - name : Set Version from manual input
41+ if : github.event_name == 'workflow_dispatch'
42+ run : |
43+ echo "Using version ${{ github.event.inputs.version }}"
44+ echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
2545
26- - name : Set up .NET
46+ - name : Set up .NET 6 (for PupNet)
2747 uses : actions/setup-dotnet@v3
2848 with :
2949 dotnet-version : ' 6.0.x'
50+
51+ - name : Install PupNet
52+ run : |
53+ sudo apt-get -y install libfuse2
54+ dotnet tool install --framework net6.0 -g KuiperZone.PupNet
3055
31- - name : Install dependencies
32- run : dotnet restore -p:PublishReadyToRun=true
33-
34- - name : Build
56+ - name : Set up .NET 7
57+ uses : actions/setup-dotnet@v3
58+ with :
59+ dotnet-version : ' 7.0.x'
60+
61+ - name : PupNet Build
3562 env :
3663 SENTRY_AUTH_TOKEN : ${{ secrets.SENTRY_AUTH_TOKEN }}
37- run : >
38- dotnet publish ./StabilityMatrix/StabilityMatrix.csproj
39- -o out -c Release -r win-x64
40- -p:Version=$env:RELEASE_VERSION -p:FileVersion=$env:RELEASE_VERSION -p:AssemblyVersion=$env:RELEASE_VERSION
41- -p:PublishReadyToRun=true -p:PublishSingleFile=true
42- -p:SentryOrg=${{ secrets.SENTRY_ORG }} -p:SentryProject=${{ secrets.SENTRY_PROJECT }}
43- -p:SentryUploadSymbols=true -p:SentryUploadSources=true
44- --self-contained true
45-
46- - name : Remove old artifacts
47- uses : c-hive/gha-remove-artifacts@v1
48- with :
49- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
50- age : ' 90 seconds'
51- skip-tags : false
64+ run : pupnet -r linux-x64 -c Release --kind appimage --app-version $RELEASE_VERSION --clean -y
65+ # Release/linux-x64/StabilityMatrix.x86_64.AppImage
5266
67+ - name : Post Build
68+ run : mv ./Release/linux-x64/StabilityMatrix.x86_64.AppImage ${{ env.out-name }}
69+
5370 - name : Upload Artifact
5471 uses : actions/upload-artifact@v2
5572 with :
56- name : StabilityMatrix
57- path : ./ out/StabilityMatrix.exe
73+ name : StabilityMatrix-${{ env.platform-id }}
74+ path : ${{ env. out-name }}
5875
5976 - name : Create Sentry release
60- if : ${{ env.MAKE_SENTRY_RELEASE == 'true ' }}
77+ if : ${{ github.event_name == 'release ' }}
6178 uses : getsentry/action-release@v1
6279 env :
63- MAKE_SENTRY_RELEASE : ${{ secrets.SENTRY_PROJECT != '' }}
80+ MAKE_SENTRY_RELEASE : ${{ secrets.SENTRY_PROJECT != '' }}
6481 SENTRY_AUTH_TOKEN : ${{ secrets.SENTRY_AUTH_TOKEN }}
6582 SENTRY_ORG : ${{ secrets.SENTRY_ORG }}
6683 SENTRY_PROJECT : ${{ secrets.SENTRY_PROJECT }}
6784 with :
6885 environment : production
6986 ignore_missing : true
7087 version : StabilityMatrix@${{ env.GIT_TAG_NAME }}
88+
89+ - name : Create Sentry release
90+ if : ${{ github.event_name == 'workflow_dispatch' }}
91+ uses : getsentry/action-release@v1
92+ env :
93+ MAKE_SENTRY_RELEASE : ${{ secrets.SENTRY_PROJECT != '' }}
94+ SENTRY_AUTH_TOKEN : ${{ secrets.SENTRY_AUTH_TOKEN }}
95+ SENTRY_ORG : ${{ secrets.SENTRY_ORG }}
96+ SENTRY_PROJECT : ${{ secrets.SENTRY_PROJECT }}
97+ with :
98+ environment : production
99+ ignore_missing : true
100+ version : StabilityMatrix@${{ github.event.inputs.version }}
101+
102+
103+ release-windows :
104+ if : github.repository == 'ionite34/StabilityMatrix' || github.event_name == 'workflow_dispatch'
105+ name : Release (win-x64)
106+ env :
107+ platform-id : win-x64
108+ runs-on : windows-latest
109+ steps :
110+ - uses : actions/checkout@v3
111+
112+ - uses : olegtarasov/get-tag@v2.1.2
113+ if : github.event_name == 'release'
114+ id : tag_name
115+ with :
116+ tagRegex : " v(.*)"
117+
118+ - name : Set Version from Tag
119+ if : github.event_name == 'release'
120+ run : |
121+ echo "Using tag ${{ env.GIT_TAG_NAME }}"
122+ echo "RELEASE_VERSION=${{ env.GIT_TAG_NAME }}" >> $env:GITHUB_ENV
123+
124+ - name : Set Version from manual input
125+ if : github.event_name == 'workflow_dispatch'
126+ run : |
127+ echo "Using version ${{ github.event.inputs.version }}"
128+ echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $env:GITHUB_ENV
129+
130+ - name : Set up .NET 7
131+ uses : actions/setup-dotnet@v3
132+ with :
133+ dotnet-version : ' 7.0.x'
134+
135+ - name : Install dependencies
136+ run : dotnet restore
137+
138+ - name : .NET Publish
139+ env :
140+ SENTRY_AUTH_TOKEN : ${{ secrets.SENTRY_AUTH_TOKEN }}
141+ run : >
142+ dotnet publish ./StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj
143+ -o out -c Release -r ${{ env.platform-id }}
144+ -p:Version=$env:RELEASE_VERSION
145+ -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
146+ -p:PublishTrimmed=true
147+ -p:SentryOrg=${{ secrets.SENTRY_ORG }} -p:SentryProject=${{ secrets.SENTRY_PROJECT }}
148+ -p:SentryUploadSymbols=true -p:SentryUploadSources=true
149+
150+ - name : Post Build
151+ run : mv ./out/StabilityMatrix.Avalonia.exe ./out/${{ env.out-name }}
152+
153+ - name : Upload Artifact
154+ uses : actions/upload-artifact@v2
155+ with :
156+ name : StabilityMatrix-${{ env.platform-id }}
157+ path : ./out/${{ env.out-name }}
158+
159+
160+ cleanup :
161+ name : Artifact Cleanup
162+ needs : [release-linux, release-windows]
163+ if : github.repository == 'ionite34/StabilityMatrix'
164+ runs-on : ubuntu-latest
165+ continue-on-error : true
166+
167+ steps :
168+ - name : Remove old artifacts
169+ uses : c-hive/gha-remove-artifacts@v1
170+ with :
171+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
172+ age : ' 1 hour'
173+ skip-recent : 2
174+ skip-tags : false
175+
176+ - name : Output
177+ if : always() && true
178+ run : exit 0
0 commit comments