Skip to content

Commit f440f1e

Browse files
committed
include release artifacts
1 parent f971606 commit f440f1e

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Publish-Release-To-Artifacts
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release:
9+
name: Release
10+
strategy:
11+
matrix:
12+
kind: ['linux', 'windows', 'macOS']
13+
include:
14+
- kind: linux
15+
os: ubuntu-latest
16+
target: linux-x64
17+
- kind: windows
18+
os: windows-latest
19+
target: win-x64
20+
- kind: macOS
21+
os: macos-latest
22+
target: osx-x64
23+
runs-on: ${{ matrix.os }}
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v1
27+
28+
- name: Setup dotnet
29+
uses: actions/setup-dotnet@v3.2.0
30+
31+
- name: Build
32+
shell: bash
33+
run: |
34+
tag=$(git describe --tags --abbrev=0)
35+
release_name="SharpFM.App-$tag-${{ matrix.target }}"
36+
37+
# Build everything
38+
dotnet publish SharpFM.App/SharpFM.App.csproj --runtime "${{ matrix.target }}" -c Release -o "$release_name"
39+
40+
# Pack files
41+
if [ "${{ matrix.target }}" == "win-x64" ]; then
42+
# Pack to zip for Windows
43+
7z a -tzip "${release_name}.zip" "./${release_name}/*"
44+
else
45+
tar czvf "${release_name}.tar.gz" "$release_name"
46+
fi
47+
48+
# Delete output directory
49+
rm -r "$release_name"
50+
51+
- name: Publish
52+
uses: softprops/action-gh-release@v1
53+
with:
54+
files: "SharpFM.App*"
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)