-
-
Notifications
You must be signed in to change notification settings - Fork 3
120 lines (114 loc) · 4.14 KB
/
release.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
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
name: Release
permissions: write-all
on:
push:
tags:
- 'v*'
jobs:
build-release:
uses: ./.github/workflows/build.yml
with:
cmake-preset: x86-release
upload-artifact-dll: release-dll
upload-artifact-vdf: release-vdf
project-version: ${{ github.ref_name }}
build-release-pdb:
uses: ./.github/workflows/build.yml
with:
cmake-preset: x86-release-pdb
upload-artifact-dll: release-dll-pdb
upload-artifact-vdf: release-vdf-pdb
project-version: ${{ github.ref_name }}-pdb
publish:
name: Publish new release
runs-on: windows-2022
needs:
- build-release
- build-release-pdb
steps:
- name: Download Release DLL
uses: actions/download-artifact@v4
with:
name: release-dll
path: out/install/x86-release/bin/
- name: Download Release VDF
uses: actions/download-artifact@v4
with:
name: release-vdf
path: out/install/x86-release/
- name: Download Release DLL PDB
uses: actions/download-artifact@v4
with:
name: release-dll-pdb
path: out/build/x86-release-pdb/
- name: Download Release DLL VDF
uses: actions/download-artifact@v4
with:
name: release-vdf-pdb
path: out/install/x86-release-pdb/
- name: Pack Release DLL
run: Compress-Archive out/install/x86-release/bin/* release-dll.zip
- name: Pack Release DLL PDB
run: Compress-Archive out/build/x86-release-pdb/* release-dll-pdb.zip
- name: Create release
uses: actions/[email protected]
env:
RELEASE_TAG: ${{ github.ref_name }}
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
if (!process.env.RELEASE_TAG) {
core.setFailed("The environment variable RELEASE_TAG is not defined.")
return;
}
try {
const response = await github.rest.repos.createRelease({
draft: process.env.RELEASE_TAG.match(/^\d+\.\d+\.\d+-[a-z0-9-]+$/i) !== null,
generate_release_notes: true,
name: process.env.RELEASE_TAG,
owner: context.repo.owner,
prerelease: process.env.RELEASE_TAG.match(/^\d+\.\d+\.\d+-[a-z0-9-]+$/i) !== null,
repo: context.repo.repo,
tag_name: process.env.RELEASE_TAG,
});
core.exportVariable('RELEASE_ID', response.data.id);
core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url);
} catch (error) {
core.setFailed(error.message);
}
- name: Upload Release DLL
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ RELEASE_UPLOAD_URL }}
asset_path: release-dll.zip
asset_name: zBassMusic-${{ github.ref_name }}.zip
asset_content_type: application/zip
- name: Upload Release VDF
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ RELEASE_UPLOAD_URL }}
asset_path: out/install/x86-release/zBassMusic.vdf
asset_name: zBassMusic-${{ github.ref_name }}.vdf
asset_content_type: application/octet-stream
- name: Upload Release DLL PDB
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ RELEASE_UPLOAD_URL }}
asset_path: release-dll-pdb.zip
asset_name: zBassMusic-${{ github.ref_name }}-pdb.zip
asset_content_type: application/zip
- name: Upload Release VDF PDB
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ RELEASE_UPLOAD_URL }}
asset_path: out/install/x86-release-pdb/zBassMusic.vdf
asset_name: zBassMusic-${{ github.ref_name }}-pdb.vdf
asset_content_type: application/octet-stream