-
Notifications
You must be signed in to change notification settings - Fork 147
159 lines (130 loc) · 4.94 KB
/
release.yml
File metadata and controls
159 lines (130 loc) · 4.94 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
name: Release
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
jobs:
semantic:
runs-on: ubuntu-latest
outputs:
new_release_version: ${{ steps.semantic.outputs.new_release_version }}
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 19.0.2
# You can specify specifying version range for the extra plugins if you prefer.
extra_plugins: |
@semantic-release/changelog@6.0.2
@semantic-release/git@10.0.1
@semantic-release/commit-analyzer@9.0.2
@semantic-release/github@8.0.7
@semantic-release/npm@9.0.1
@semantic-release/release-notes-generator@10.0.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: version
id: version
run: |
export commit=`git rev-list --tags --max-count=1`
export last_release_version=`git describe --abbrev=0 --tags $tag`
export new_release_version=v${{ steps.semantic.outputs.new_release_version }}
export version=${new_release_version:-$last_release_version}
echo "version=${version}" >> $GITHUB_OUTPUT
- name: delete node_modules
run: |
rm -rf node_modules .git
- name: zip
uses: thedoctor0/zip-release@main
with:
type: zip
filename: ${{ steps.version.outputs.version }}.zip
directory: .
- uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' #|| startsWith(github.ref, 'refs/tags')
with:
allowUpdates: true
artifacts: ${{ steps.version.outputs.version }}.zip
tag: ${{ steps.version.outputs.version }}
nightly-release:
runs-on: ${{ matrix.os }}
needs: semantic
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- env:
version: ${{needs.semantic.outputs.version}}
run: echo "$version"
- uses: actions/checkout@v3
- name: cache
uses: actions/cache@v2
with:
path: "**/cpm_modules"
key: ${{ matrix.os }}-${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
- name: Install dependencies on ubuntu
if: startsWith(matrix.os,'ubuntu')
run: |
sudo apt update
sudo apt install -y build-essential cmake mesa-common-dev libgl1-mesa-dev libx11-dev mesa-common-dev mesa-utils libgl-dev python3-distutils libgl1-mesa-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev
- name: configure
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DENABLE_TEST_COVERAGE=OFF
- name: build
if: startsWith(matrix.os,'ubuntu') == false
run: cmake --build build --parallel --config MinSizeRel
# On ubuntu, github actions doesn't support parallel build yet. should be fixed in the future.
- name: build
if: startsWith(matrix.os,'ubuntu') == true
run: cmake --build build --config MinSizeRel
- name: zip
uses: thedoctor0/zip-release@main
with:
type: zip
filename: ${{ matrix.os }}-${{ needs.semantic.outputs.version }}.zip
directory: build/bin/
- uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' #|| startsWith(github.ref, 'refs/tags')
with:
allowUpdates: true
artifacts: build/bin/${{ matrix.os }}-${{ needs.semantic.outputs.version }}.zip
tag: ${{ needs.semantic.outputs.version }}
nightly-release-emscripten:
runs-on: ubuntu-latest
container: emscripten/emsdk
needs: semantic
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: "**/cpm_modules"
key: emscripten-${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
- name: Emscripten Build
run: ./scripts/emscripten-build.sh
- name: zip
uses: thedoctor0/zip-release@main
with:
type: zip
filename: emscripten-${{ needs.semantic.outputs.version }}.zip
directory: bin-emscripten/bin/
- uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' #|| startsWith(github.ref, 'refs/tags')
with:
allowUpdates: true
artifacts: bin-emscripten/bin/emscripten-${{ needs.semantic.outputs.version }}.zip
tag: ${{ needs.semantic.outputs.version }}