-
Notifications
You must be signed in to change notification settings - Fork 77
73 lines (58 loc) · 2.28 KB
/
develop.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
name: Developer release
on:
push:
branches:
- develop
jobs:
dev-build:
name: Develop build
# All architectures supported
strategy:
matrix:
arch: ['win-x64', 'win-arm64', 'linux-x64', 'linux-arm64', 'osx-x64', 'osx-arm64']
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.201
- name: Build
shell: bash
# run: bash build-all.sh
run: |
version=$(cat src/GICutscenes.csproj | grep -oP "<Version>\K([0-9]\.[0-9]\.[0-9])")
release_name="GICutscenes-$version-${GITHUB_SHA::6}-${{ matrix.arch }}"
release_name_standalone="$release_name-standalone"
# Self contained
dotnet publish -c Release -r "${{ matrix.arch }}" -o "$release_name_standalone" --self-contained
# Framework dependant
dotnet publish -c Release -r "${{ matrix.arch }}" -o "$release_name" --self-contained false -p:PublishTrimmed=false
if [ "${{ matrix.arch }}" == "win-x64" ]; then
archive_type="zip"
# Pack for standalone version
7z a -tzip "${release_name_standalone}.zip" "./${release_name_standalone}/*"
# Pack for Framework dependant version
7z a -tzip "${release_name}.zip" "./${release_name}/*"
else
archive_type="tar.gz"
tar czvf "${release_name_standalone}.tar.gz" "$release_name_standalone"
tar czvf "${release_name}.tar.gz" "$release_name"
fi
rm -r "$release_name_standalone"
rm -r "$release_name"
echo "zip_standalone=${release_name_standalone}.${archive_type}" >> $GITHUB_ENV
echo "zip_native=${release_name}.${archive_type}" >> $GITHUB_ENV
- name: 'Upload standalone build'
uses: actions/upload-artifact@v4
with:
name: ${{ env.zip_standalone }}
path: ${{ env.zip_standalone }}
retention-days: 7
- name: 'Upload native build'
uses: actions/upload-artifact@v4
with:
name: ${{ env.zip_native }}
path: ${{ env.zip_native }}
retention-days: 7