-
Notifications
You must be signed in to change notification settings - Fork 3
91 lines (78 loc) · 2.96 KB
/
ReleaseAll.yml
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
name: ReleaseAll
on:
release:
types: [published]
jobs:
release:
name: Release
strategy:
matrix:
kind: ["linux", "windows", "macOS"]
include:
- kind: linux
os: ubuntu-latest
target: linux-x64
- kind: windows
os: windows-latest
target: win-x64
- kind: macOS
os: macos-latest
target: osx-x64
runs-on: ${{ matrix.os }}
env:
DOTNET_NOLOGO: true
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: BuildFrameworkDep
shell: bash
working-directory: src
run: |
tag=$(git describe --tags --abbrev=0)
release_name="QnapBackupDecryptor-FD-$tag-${{ matrix.target }}"
# Build everything
dotnet publish ./QnapBackupDecryptor.Console/QnapBackupDecryptor.Console.csproj -c Release -f net8.0 -r ${{ matrix.target }} --self-contained false -p:PublishSingleFile=true -o "./releases/$release_name" -p:DebugType=None -p:DebugSymbols=false -p:Version=${tag}
# Pack files
if [ "${{ matrix.target }}" == "win-x64" ]; then
# Pack to zip for Windows
mv ./releases/$release_name/QnapBackupDecryptor.Console.exe ./releases/$release_name/QnapBackupDecryptor.exe
7z a -tzip "../${release_name}.zip" "./releases/${release_name}/*"
else
mv ./releases/$release_name/QnapBackupDecryptor.Console ./releases/$release_name/QnapBackupDecryptor
tar czvf "../${release_name}.tar.gz" "./releases/$release_name"
fi
# Delete output directory
rm -r "./releases/$release_name"
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: "QnapBackupDecryptor-*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: BuildSelfContained
shell: bash
working-directory: src
run: |
tag=$(git describe --tags --abbrev=0)
release_name="QnapBackupDecryptor-SC-$tag-${{ matrix.target }}"
# Build everything
dotnet publish QnapBackupDecryptor.sln -c Release -f net8.0 -r ${{ matrix.target }} --self-contained true -o "./releases/$release_name" -p:DebugType=None -p:DebugSymbols=false -p:Version=${tag}
# Pack files
if [ "${{ matrix.target }}" == "win-x64" ]; then
# Pack to zip for Windows
7z a -tzip "../${release_name}.zip" "./releases/${release_name}/*"
else
tar czvf "../${release_name}.tar.gz" "./releases/$release_name"
fi
# Delete output directory
rm -r "./releases/$release_name"
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: "QnapBackupDecryptor-*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}