-
Notifications
You must be signed in to change notification settings - Fork 57
166 lines (163 loc) · 10.2 KB
/
build.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Build
on:
push:
branches:
- master
tags:
- '*'
concurrency:
group: ${{ github.sha }}
cancel-in-progress: true
jobs:
linux:
runs-on: ubuntu-latest
container: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-cross-arm64 # https://github.com/dotnet/versions/blob/main/build-info/docker/image-info.dotnet-dotnet-buildtools-prereqs-docker-main.json
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Publish Avalonia
run: |
dotnet publish MusicDecrypto.Commandline/MusicDecrypto.Commandline.csproj -c Release -p:PublishAot=false -o ./generic
dotnet publish MusicDecrypto.Avalonia/MusicDecrypto.Avalonia.csproj -c Release -o ./generic
dotnet publish MusicDecrypto.Avalonia/MusicDecrypto.Avalonia.csproj -c Release -r linux-x64 --sc -p:PublishSingleFile=true -p:PublishTrimmed=true -p:TrimMode=partial -o ./gui-x64
dotnet publish MusicDecrypto.Avalonia/MusicDecrypto.Avalonia.csproj -c Release -r linux-arm64 --sc -p:PublishSingleFile=true -p:PublishTrimmed=true -p:TrimMode=partial -o ./gui-arm64
- name: Publish CLI
run: |
dotnet publish MusicDecrypto.Commandline/MusicDecrypto.Commandline.csproj -c Release -r linux-x64 -p:CppCompilerAndLinker=clang-9 -o ./cli-x64
dotnet publish MusicDecrypto.Commandline/MusicDecrypto.Commandline.csproj -c Release -r linux-arm64 -p:CppCompilerAndLinker=clang-9 -p:SysRoot=/crossrootfs/arm64 -p:StripSymbols=false -o ./cli-arm64
- name: Extract tag name
id: tag
if: startsWith(github.ref, 'refs/tags/')
uses: olegtarasov/[email protected]
- name: Pack
if: startsWith(github.ref, 'refs/tags/')
run: |
tar cavf musicdecrypto-all-$GIT_TAG_NAME-net8.0-noarch.tar.xz -C ./generic/ $(cd ./generic/ && echo *)
sha256sum musicdecrypto-all-$GIT_TAG_NAME-net8.0-noarch.tar.xz > musicdecrypto-all-$GIT_TAG_NAME-net7.0-noarch.tar.xz.sha256
aarch64-linux-gnu-strip ./cli-arm64/musicdecrypto
tar cavf musicdecrypto-gui-$GIT_TAG_NAME-linux-x64.tar.xz -C ./gui-x64/ $(cd ./gui-x64/ && echo *)
tar cavf musicdecrypto-gui-$GIT_TAG_NAME-linux-arm64.tar.xz -C ./gui-arm64/ $(cd ./gui-arm64/ && echo *)
tar cavf musicdecrypto-cli-$GIT_TAG_NAME-linux-x64.tar.xz -C ./cli-x64/ musicdecrypto
tar cavf musicdecrypto-cli-$GIT_TAG_NAME-linux-arm64.tar.xz -C ./cli-arm64/ musicdecrypto
sha256sum musicdecrypto-gui-$GIT_TAG_NAME-linux-x64.tar.xz > musicdecrypto-gui-$GIT_TAG_NAME-linux-x64.tar.xz.sha256
sha256sum musicdecrypto-gui-$GIT_TAG_NAME-linux-arm64.tar.xz > musicdecrypto-gui-$GIT_TAG_NAME-linux-arm64.tar.xz.sha256
sha256sum musicdecrypto-cli-$GIT_TAG_NAME-linux-x64.tar.xz > musicdecrypto-cli-$GIT_TAG_NAME-linux-x64.tar.xz.sha256
sha256sum musicdecrypto-cli-$GIT_TAG_NAME-linux-arm64.tar.xz > musicdecrypto-cli-$GIT_TAG_NAME-linux-arm64.tar.xz.sha256
- name: GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
musicdecrypto-all-${{ steps.tag.outputs.tag }}-net8.0-noarch.tar.xz
musicdecrypto-all-${{ steps.tag.outputs.tag }}-net8.0-noarch.tar.xz.sha256
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-linux-x64.tar.xz
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-linux-x64.tar.xz.sha256
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-linux-arm64.tar.xz
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-linux-arm64.tar.xz.sha256
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-linux-x64.tar.xz
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-linux-x64.tar.xz.sha256
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-linux-arm64.tar.xz
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-linux-arm64.tar.xz.sha256
macos:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Publish Avalonia
run: |
dotnet publish MusicDecrypto.Avalonia/MusicDecrypto.Avalonia.csproj -c Release -r osx-x64 --sc -p:PublishSingleFile=true -p:PublishTrimmed=true -p:TrimMode=partial -o ./gui-x64
dotnet publish MusicDecrypto.Avalonia/MusicDecrypto.Avalonia.csproj -c Release -r osx-arm64 --sc -p:PublishSingleFile=true -p:PublishTrimmed=true -p:TrimMode=partial -o ./gui-arm64
- name: Publish CLI
run: |
dotnet publish MusicDecrypto.Commandline/MusicDecrypto.Commandline.csproj -c Release -r osx-x64 -o ./cli-x64
dotnet publish MusicDecrypto.Commandline/MusicDecrypto.Commandline.csproj -c Release -r osx-arm64 -o ./cli-arm64
- name: Extract tag name
id: tag
if: startsWith(github.ref, 'refs/tags/')
uses: olegtarasov/[email protected]
- name: Pack
if: startsWith(github.ref, 'refs/tags/')
run: |
tar cavf musicdecrypto-gui-$GIT_TAG_NAME-osx-x64.tar.xz -C ./gui-x64/ $(cd ./gui-x64/ && echo *)
tar cavf musicdecrypto-gui-$GIT_TAG_NAME-osx-arm64.tar.xz -C ./gui-arm64/ $(cd ./gui-arm64/ && echo *)
tar cavf musicdecrypto-cli-$GIT_TAG_NAME-osx-x64.tar.xz -C ./cli-x64/ musicdecrypto
tar cavf musicdecrypto-cli-$GIT_TAG_NAME-osx-arm64.tar.xz -C ./cli-arm64/ musicdecrypto
shasum -a 256 musicdecrypto-gui-$GIT_TAG_NAME-osx-x64.tar.xz > musicdecrypto-gui-$GIT_TAG_NAME-osx-x64.tar.xz.sha256
shasum -a 256 musicdecrypto-gui-$GIT_TAG_NAME-osx-arm64.tar.xz > musicdecrypto-gui-$GIT_TAG_NAME-osx-arm64.tar.xz.sha256
shasum -a 256 musicdecrypto-cli-$GIT_TAG_NAME-osx-x64.tar.xz > musicdecrypto-cli-$GIT_TAG_NAME-osx-x64.tar.xz.sha256
shasum -a 256 musicdecrypto-cli-$GIT_TAG_NAME-osx-arm64.tar.xz > musicdecrypto-cli-$GIT_TAG_NAME-osx-arm64.tar.xz.sha256
- name: GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-osx-x64.tar.xz
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-osx-x64.tar.xz.sha256
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-osx-arm64.tar.xz
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-osx-arm64.tar.xz.sha256
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-osx-x64.tar.xz
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-osx-x64.tar.xz.sha256
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-osx-arm64.tar.xz
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-osx-arm64.tar.xz.sha256
win:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Publish Avalonia
run: |
dotnet publish MusicDecrypto.Avalonia/MusicDecrypto.Avalonia.csproj -c Release -r win-x64 --sc -p:PublishSingleFile=true -p:PublishTrimmed=true -p:TrimMode=partial -o ./gui-x64
dotnet publish MusicDecrypto.Avalonia/MusicDecrypto.Avalonia.csproj -c Release -r win-arm64 --sc -p:PublishSingleFile=true -p:PublishTrimmed=true -p:TrimMode=partial -o ./gui-arm64
- name: Publish CLI
run: |
dotnet publish MusicDecrypto.Commandline/MusicDecrypto.Commandline.csproj -c Release -r win-x64 -o ./cli-x64
dotnet publish MusicDecrypto.Commandline/MusicDecrypto.Commandline.csproj -c Release -r win-arm64 -o ./cli-arm64
- name: Extract tag name
id: tag
if: startsWith(github.ref, 'refs/tags/')
uses: olegtarasov/[email protected]
- name: Pack
if: startsWith(github.ref, 'refs/tags/')
run: |
7z a musicdecrypto-gui-$env:GIT_TAG_NAME-win-x64.7z .\gui-x64\*
7z a musicdecrypto-gui-$env:GIT_TAG_NAME-win-arm64.7z .\gui-arm64\*
7z a musicdecrypto-cli-$env:GIT_TAG_NAME-win-x64.7z .\cli-x64\musicdecrypto.exe
7z a musicdecrypto-cli-$env:GIT_TAG_NAME-win-arm64.7z .\cli-arm64\musicdecrypto.exe
(Get-FileHash musicdecrypto-gui-$env:GIT_TAG_NAME-win-x64.7z SHA256).Hash + " musicdecrypto-gui-$env:GIT_TAG_NAME-win-x64.7z" > musicdecrypto-gui-$env:GIT_TAG_NAME-win-x64.7z.sha256
(Get-FileHash musicdecrypto-gui-$env:GIT_TAG_NAME-win-arm64.7z SHA256).Hash + " musicdecrypto-gui-$env:GIT_TAG_NAME-win-arm64.7z" > musicdecrypto-gui-$env:GIT_TAG_NAME-win-arm64.7z.sha256
(Get-FileHash musicdecrypto-cli-$env:GIT_TAG_NAME-win-x64.7z SHA256).Hash + " musicdecrypto-cli-$env:GIT_TAG_NAME-win-x64.7z" > musicdecrypto-cli-$env:GIT_TAG_NAME-win-x64.7z.sha256
(Get-FileHash musicdecrypto-cli-$env:GIT_TAG_NAME-win-arm64.7z SHA256).Hash + " musicdecrypto-cli-$env:GIT_TAG_NAME-win-arm64.7z" > musicdecrypto-cli-$env:GIT_TAG_NAME-win-arm64.7z.sha256
- name: GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-win-x64.7z
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-win-x64.7z.sha256
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-win-arm64.7z
musicdecrypto-gui-${{ steps.tag.outputs.tag }}-win-arm64.7z.sha256
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-win-x64.7z
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-win-x64.7z.sha256
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-win-arm64.7z
musicdecrypto-cli-${{ steps.tag.outputs.tag }}-win-arm64.7z.sha256
body: |-
- `noarch` variant depends on [.NET Runtime](https://dotnet.microsoft.com/en-us/download);
- `x64` variant of CLI was built targeting `x86-64-v3` (AVX2).
nuget:
runs-on: windows-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Publish library
run: dotnet pack MusicDecrypto.Library/MusicDecrypto.Library.csproj -c Release -o .
- name: NuGet Release
run: dotnet nuget push MusicDecrypto.Library*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json