-
Notifications
You must be signed in to change notification settings - Fork 6
86 lines (75 loc) · 2.38 KB
/
Copy pathrelease.yml
File metadata and controls
86 lines (75 loc) · 2.38 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
name: Release
on:
push:
tags: ['v*']
permissions:
contents: write # gh release create
id-token: write # aas-sign OIDC handshake
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install mingw-w64
run: sudo apt-get update && sudo apt-get install -y mingw-w64
- name: Build source tarball
run: cmake -P cmake/SourceRelease.cmake
- name: Cross-compile dcmake.exe
run: |
cmake -B build \
-DCMAKE_TOOLCHAIN_FILE=cmake/x86_64-w64-mingw32.cmake \
-DCMAKE_BUILD_TYPE=Release
cmake --build build
x86_64-w64-mingw32-strip build/dcmake.exe
- name: Upload source tarball
uses: actions/upload-artifact@v4
with:
name: source-tarball
path: dcmake-*.tar.gz
- name: Upload dcmake.exe
uses: actions/upload-artifact@v4
with:
name: dcmake-exe
path: build/dcmake.exe
sign-and-release:
needs: build
runs-on: ubuntu-latest
environment: release
steps:
- name: Download source tarball
uses: actions/download-artifact@v4
with:
name: source-tarball
- name: Download dcmake.exe
uses: actions/download-artifact@v4
with:
name: dcmake-exe
- name: Sign dcmake.exe
uses: skeeto/aas-sign@v1.0.0
with:
endpoint: ${{ secrets.TRUSTED_SIGNING_ENDPOINT }}
account: ${{ secrets.TRUSTED_SIGNING_ACCOUNT }}
profile: ${{ secrets.CERTIFICATE_PROFILE }}
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
files: dcmake.exe
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION=${GITHUB_REF_NAME#v}
# Tags like v1.8.0-rcN are release-candidate test runs: publish
# as a draft prerelease so they don't trigger release immutability
# and can be deleted/retried freely.
FLAGS=()
if [[ "$VERSION" == *-rc* ]]; then
FLAGS+=(--draft --prerelease)
fi
gh release create "$GITHUB_REF_NAME" \
--repo "$GITHUB_REPOSITORY" \
--title "$VERSION" \
"${FLAGS[@]}" \
dcmake-${VERSION}.tar.gz \
dcmake.exe