-
Notifications
You must be signed in to change notification settings - Fork 3
164 lines (149 loc) · 5.12 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
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
name: Release
#on:
# push:
# tags:
# - 'v*.*.*'
on: pull_request # for test purpose.
env:
file-name: s2c
jobs:
create-release-binaries:
strategy:
matrix:
os:
- runner: macos-latest
shell: bash
- runner: windows-latest
shell: msys2 {0}
- runner: ubuntu-latest
shell: bash
runs-on: ${{ matrix.os.runner }}
defaults:
run:
shell: ${{ matrix.os.shell }}
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Prepares environment for building
uses: ./.github/actions/setup
- name: Setup mingwX64
uses: msys2/setup-msys2@v2
if: ${{ matrix.os.runner == 'windows-latest' }}
with:
msystem: mingw64
update: true
path-type: inherit
install: >-
touch
zip
tar
make
mingw-w64-x86_64-gcc
mingw-w64-x86_64-cmake
mingw-w64-x86_64-extra-cmake-modules
mingw64/mingw-w64-x86_64-cyrus-sasl
- name: Prepare nodeJS environment for integrity check
uses: ./.github/actions/setup-nodejs
with:
shell: ${{ matrix.os.shell }}
- name: Build Native Binary for macos
if: matrix.os.runner == 'macos-latest'
uses: burrunan/gradle-cache-action@v1
with:
gradle-version: wrapper
job-id: ${{ matrix.os.runner }}
arguments: releaseMacOS
- name: Build Native Binary for Windows
if: matrix.os.runner == 'windows-latest'
uses: burrunan/gradle-cache-action@v1
with:
gradle-version: wrapper
job-id: ${{ matrix.os.runner }}
arguments: releaseWindows
- name: Build Native Binary for Linux
if: matrix.os.runner == 'ubuntu-latest'
uses: burrunan/gradle-cache-action@v1
with:
gradle-version: wrapper
job-id: ${{ matrix.os.runner }}
arguments: releaseLinux
- name: CLI Integrity check
uses: ./.github/actions/cli-integrity-check
with:
shell: ${{ matrix.os.shell }}
continue-on-error: true # should be false
- name: Uploading macos Arm64 binaries
uses: actions/upload-artifact@v4
if: matrix.os.runner == 'macos-latest'
with:
name: ${{ env.file-name }}-macosArm64-binaries # add tag to file name.
path: shared/build/bin/macosArm64/releaseExecutable/
if-no-files-found: error
- name: Uploading macos x64 binaries
uses: actions/upload-artifact@v4
if: matrix.os.runner == 'macos-latest'
with:
name: ${{ env.file-name }}-macosX64-binaries # add tag to file name.
path: shared/build/bin/macosX64/releaseExecutable/
if-no-files-found: error
- name: Uploading Linux binaries
uses: actions/upload-artifact@v4
if: matrix.os.runner == 'ubuntu-latest'
with:
name: ${{ env.file-name }}-linuxX64-binaries # add tag to file name.
path: shared/build/bin/linuxX64/releaseExecutable/
if-no-files-found: error
- name: Uploading Windows binaries
uses: actions/upload-artifact@v4
if: matrix.os.runner == 'windows-latest'
with:
name: ${{ env.file-name }}-mingwX64-binaries # add tag to file name.
path: shared/build/bin/mingwX64/releaseExecutable/
if-no-files-found: error
- name: Uploading script
uses: actions/upload-artifact@v4
if: matrix.os.runner == 'ubuntu-latest' # should only run once.
with:
name: s2c
path: s2c
if-no-files-found: error
upload-to-release:
permissions:
contents: write
deployments: write
runs-on: ubuntu-latest
needs: create-release-binaries
steps:
- name: Download release artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: ${{ env.file-name }}-*-binaries
merge-multiple: false
- name: Download script artifact
uses: actions/download-artifact@v4
with:
path: artifacts
name: s2c
- name: Compress binaries
run: |
cd artifacts
zip -r s2c-linuxX64-binaries.zip s2c-linuxX64-binaries
zip -r s2c-macosArm64-binaries.zip s2c-macosArm64-binaries
zip -r s2c-macosX64-binaries.zip s2c-macosX64-binaries
zip -r s2c-mingwX64-binaries.zip s2c-mingwX64-binaries
- name: Display structure of downloaded files
run: ls -R
- name: Create Github release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: development
draft: true # For test purposes. Should be false
prerelease: true # For test purposes. Should be false
files: |
artifacts/s2c-linuxX64-binaries.zip
artifacts/s2c-macosArm64-binaries.zip
artifacts/s2c-macosX64-binaries.zip
artifacts/s2c-mingwX64-binaries.zip
artifacts/s2c