-
Notifications
You must be signed in to change notification settings - Fork 2
154 lines (125 loc) · 4.49 KB
/
Copy pathrelease_generator.yml
File metadata and controls
154 lines (125 loc) · 4.49 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
name: Release generator
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
env:
CMAKE_BUILD_TYPE: RelWithDebInfo
jobs:
create-linux-binary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get required tools
run: sudo apt install gcc-9 g++-9 zip
- name: Create build environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DDEPLOYMENT_BUILD:BOOL=YES
env:
CC: gcc-9
CXX: g++-9
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config $CMAKE_BUILD_TYPE --target signet
- name: Zip executable
working-directory: ${{github.workspace}}/build
run: zip signet_linux signet
- uses: actions/upload-artifact@v4
with:
name: signet_linux.zip
path: build/signet_linux.zip
- uses: actions/upload-artifact@v4
with:
name: RELEASE.md
path: ./RELEASE.md
create-macos-binary:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake Using Default Compiler
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DDEPLOYMENT_BUILD:BOOL=YES
- name: Install Code Signing Certificate
uses: apple-actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.APPLE_CODESIGN_CERT_P12_BASE64 }}
p12-password: ${{ secrets.APPLE_CODESIGN_CERT_PASSWORD }}
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config $CMAKE_BUILD_TYPE --target signet
- name: Sign executable
env:
IDENTITY: ${{ secrets.APPLE_CODESIGN_CERT_IDENTITY }}
working-directory: ${{github.workspace}}/build
run:
codesign --sign "$IDENTITY" --timestamp --options=runtime signet -v
- name: Zip executable
working-directory: ${{github.workspace}}/build
shell: bash
run: zip signet_macos signet
- name: Notarize executable
env:
APPLE_ID: ${{ secrets.APPLE_NOTARIZE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_NOTARIZE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
working-directory: ${{github.workspace}}/build
run: |
xcrun notarytool submit signet_macos.zip --apple-id "$APPLE_ID" --password "$APPLE_PASSWORD" --team-id "$APPLE_TEAM_ID" --wait
- uses: actions/upload-artifact@v4
with:
name: signet_macos.zip
path: build/signet_macos.zip
create-windows-binary:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake using default compiler
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DDEPLOYMENT_BUILD:BOOL=YES
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config $CMAKE_BUILD_TYPE --target signet
- name: Copy executable to build directory
# When building visual studio projects, it puts the binaries in subdirectories
shell: bash
working-directory: ${{github.workspace}}/build
run: mv $CMAKE_BUILD_TYPE/signet.exe ./signet.exe
- name: Zip executable
working-directory: ${{github.workspace}}/build
run: 7z a signet_windows.zip signet.exe
- uses: actions/upload-artifact@v4
with:
name: signet_windows.zip
path: build/signet_windows.zip
generate-release:
runs-on: ubuntu-latest
needs: [create-linux-binary, create-windows-binary, create-macos-binary]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Get Artifacts
uses: actions/download-artifact@v4
- name: Display structure of downloaded files
run: ls -la
- name: Create Release
uses: softprops/action-gh-release@v1
with:
draft: false
body_path: RELEASE.md/RELEASE.md
files: |
RELEASE.md/*
signet_linux.zip/*
signet_windows.zip/*
signet_macos.zip/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}