-
-
Notifications
You must be signed in to change notification settings - Fork 133
174 lines (143 loc) · 4.74 KB
/
Copy pathrelease.yml
File metadata and controls
174 lines (143 loc) · 4.74 KB
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
167
168
169
170
171
172
173
174
name: Build danser
on:
workflow_dispatch:
inputs:
version:
description: 'Danser version'
type: string
required: true
draft:
description: 'Create draft release'
type: boolean
required: false
default: true
sign:
description: 'Sign files (Windows only)'
type: boolean
required: false
default: false
jobs:
build_windows:
name: Building windows version
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- name: Checkout master branch
uses: actions/checkout@v3
- name: Install winlibs
uses: bwoodsend/setup-winlibs-action@v1
- name: Install golang
uses: actions/setup-go@v3
with:
go-version: '1.24.1'
cache: true
- name: Build danser
run: |
version="${{ inputs.version }}"
export DANSER_BUILD_MODE=0
if [[ ${{ inputs.sign }} == 'true' || ${{ inputs.sign }} == true ]]
then
export DANSER_BUILD_MODE=1
./dist-win.sh $version
if [ ! -f "dist/build-win/danser-core.dll" ]; then
echo "Danser failed to build"
exit 1
fi
else
./dist-win.sh $version
if [ ! -f "dist/artifacts/danser-${version// /-s}-win.zip" ]; then
echo "Danser failed to build"
exit 1
fi
fi
id: build
- name: Sign files with Trusted Signing
if: ${{ inputs.sign == true || inputs.sign == 'true' }}
uses: azure/trusted-signing-action@v0
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
endpoint: https://weu.codesigning.azure.net/
trusted-signing-account-name: mailatwiekume
certificate-profile-name: danser
files-folder: ${{ github.workspace }}/dist/build-win
files-folder-filter: exe,dll
files-folder-recurse: true
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Pack danser
if: ${{ inputs.sign == true || inputs.sign == 'true' }}
run: |
version="${{ inputs.version }}"
export DANSER_BUILD_MODE=2
./dist-win.sh $version
if [ ! -f "dist/artifacts/danser-${version// /-s}-win.zip" ]; then
echo "Danser failed to build"
exit 1
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
if: ${{ !failure() && steps.build.conclusion != 'failure' }}
with:
name: danser-win
path: dist/artifacts/*
build_linux:
name: Building linux version
runs-on: ubuntu-22.04
steps:
- name: Checkout branch
uses: actions/checkout@v3
- name: Install needed packages
run: |
sudo apt-get update
sudo apt-get install xorg-dev libgl1-mesa-dev libgtk-3-dev
- name: Install golang
uses: actions/setup-go@v3
with:
go-version: '1.24.1'
cache: true
- name: Build danser
run: |
version="${{ inputs.version }}"
chmod +x dist-linux.sh
./dist-linux.sh $version
if [ ! -f "dist/artifacts/danser-${version// /-s}-linux.zip" ]; then
echo "Danser failed to build"
exit 1
fi
id: build
- name: Upload artifact
uses: actions/upload-artifact@v4
if: ${{ !failure() && steps.build.conclusion != 'failure' }}
with:
name: danser-linux
path: dist/artifacts/*
publish_release:
name: Publish draft release
if: ${{ !cancelled() && needs.build_windows.result == 'success' && needs.build_linux.result == 'success' && (inputs.draft == true || inputs.draft == 'true') }}
needs: [build_windows, build_linux]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: danser-*
path: artifacts
merge-multiple: true
- name: Create release
id: create_release
run: |
set -xe
shopt -s nullglob
version="${{ inputs.version }}"
NAME="${version// / snapshot }"
TAGNAME="${version// /-s}"
gh release create "$TAGNAME" --draft -t "$NAME" --target "master" $(for a in artifacts/*.{zip,tar.xz}; do echo $a; done)
env:
GITHUB_TOKEN: ${{ github.token }}