-
Notifications
You must be signed in to change notification settings - Fork 13
181 lines (149 loc) · 4.53 KB
/
build_release.yml
File metadata and controls
181 lines (149 loc) · 4.53 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
175
176
177
178
179
180
181
name: Create Release
# NOTE: this file is only intended to be used when triggered by a version tag!
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
env:
OUTPUT_DIR: ./build/packages
PUBLISH_DIR: ./build/publish
jobs:
build-win:
name: Windows builds
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: '${{ github.ref }}'
- name: Set environment
shell: bash
run: |
echo "VERSION=$(echo ${{ github.ref_name }} | cut -c 2-)" >> $GITHUB_ENV
echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: Create directories
shell: bash
run: |
mkdir -p "$OUTPUT_DIR"
mkdir -p "$PUBLISH_DIR"
- name: Publish Windows RIDs
shell: bash
run: ./ci/publish_all_host.sh
- name: Archive builds
shell: bash
run: |
cd "$PUBLISH_DIR"
tar -czvf win-builds.tgz --exclude='*.pdb' *
- name: Upload build archive
uses: actions/upload-artifact@v4
with:
name: win-builds
path: ${{ env.PUBLISH_DIR }}/win-builds.tgz
retention-days: 5
build-mac:
name: macOS builds
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: '${{ github.ref }}'
- name: Set environment
shell: bash
run: |
echo "VERSION=$(echo ${{ github.ref_name }} | cut -c 2-)" >> $GITHUB_ENV
echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: Create directories
shell: bash
run: |
mkdir -p "$OUTPUT_DIR"
mkdir -p "$PUBLISH_DIR"
- name: Publish macOS RIDs
shell: bash
run: ./ci/publish_all_host.sh
- name: Archive builds
shell: bash
run: |
cd "$PUBLISH_DIR"
tar -czvf mac-builds.tgz --exclude='*.pdb' *
- name: Upload build archive
uses: actions/upload-artifact@v4
with:
name: mac-builds
path: ${{ env.PUBLISH_DIR }}/mac-builds.tgz
retention-days: 5
package_release:
name: Linux builds, package and release
needs: [build-win, build-mac]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: '${{ github.ref }}'
- name: Set environment
shell: bash
run: |
echo "VERSION=$(echo ${{ github.ref_name }} | cut -c 2-)" >> $GITHUB_ENV
echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV
- name: Create directories
shell: bash
run: |
mkdir -p "$OUTPUT_DIR"
mkdir -p "$PUBLISH_DIR"
- name: Install utilities
# zip for packaging windows builds
# nsis for windows installer
run: sudo apt-get update && sudo apt-get install zip nsis
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: Publish Linux RIDs
shell: bash
run: ./ci/publish_all_host.sh
- name: Download Windows build artifact
uses: actions/download-artifact@v4
with:
name: win-builds
path: ${{ env.PUBLISH_DIR }}
- name: Download macOS build artifact
uses: actions/download-artifact@v4
with:
name: mac-builds
path: ${{ env.PUBLISH_DIR }}
- name: Extract build archives
run: |
cd "$PUBLISH_DIR"
tar -xzvf win-builds.tgz
tar -xzvf mac-builds.tgz
- name: Package all RIDs
run: ${{ github.workspace }}/ci/package_all.sh
- name: Create installers for Windows
run: ${{ github.workspace }}/ci/create_win_installer.sh
- name: Create AppImage (x86_64)
env:
ARCH: x86_64
run: ${{ github.workspace }}/ci/create_appimage.sh
- name: Create AppImage (aarch64)
env:
ARCH: aarch64
run: ${{ github.workspace }}/ci/create_appimage.sh
- name: Generate Release
uses: softprops/action-gh-release@v2
with:
draft: true
files: ${{ env.OUTPUT_DIR }}/*