This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 60
183 lines (171 loc) · 5.54 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: Create new release
on:
push:
tags:
- v*
jobs:
linux-build:
name: Build Blackjack for Linux
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
branch: feature/release_ci
repository: setzer22/blackjack
lfs: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2
- run: cargo build --release
- run: ./build_godot_plugin.sh
- run: |
mkdir ./blackjack_linux
cp ./target/release/blackjack_ui ./blackjack_linux
chmod +x ./blackjack_linux/blackjack_ui
cp -r ./blackjack_lua ./blackjack_linux
- uses: actions/upload-artifact@v3
with:
name: blackjack-linux
path: blackjack_linux
- uses: actions/upload-artifact@v3
with:
name: blackjack-godot-base
path: target/godot_plugin
windows-build:
name: Build Blackjack for Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
branch: feature/release_ci
repository: setzer22/blackjack
lfs: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2
- run: cargo build --release
- run: cargo build --release -p blackjack_godot
- run: |
mkdir ./blackjack_windows
ls target/release
cp ./target/release/blackjack_ui.exe ./blackjack_windows
cp -r ./blackjack_lua ./blackjack_windows
shell: bash
- uses: actions/upload-artifact@v3
with:
name: blackjack-windows
path: blackjack_windows/
- uses: actions/upload-artifact@v3
with:
name: blackjack-godot-windows-lib
path: target/release/blackjack_godot.dll
macos-build:
name: Build Blackjack for MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
branch: feature/release_ci
repository: setzer22/blackjack
lfs: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2
- run: cargo build --release
- run: cargo build --release -p blackjack_godot
- run: |
mkdir ./blackjack_macos
ls target/release/
cp ./target/release/blackjack_ui ./blackjack_macos
chmod +x ./blackjack_macos/blackjack_ui
cp -r ./blackjack_lua ./blackjack_macos
shell: bash
- uses: actions/upload-artifact@v3
with:
name: blackjack-macos
path: blackjack_macos/
- uses: actions/upload-artifact@v3
with:
name: blackjack-godot-macos-lib
path: target/release/libblackjack_godot.dylib
create-release:
name: Assemble packages and create release
needs:
- windows-build
- linux-build
- macos-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get pushed tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Print tag
run: echo The tag is $RELEASE_VERSION
- name: Download editor executable (Linux)
uses: actions/download-artifact@v3
with:
name: blackjack-linux
path: blackjack_linux
- name: Download editor executable (Windows)
uses: actions/download-artifact@v3
with:
name: blackjack-windows
path: blackjack_windows
- name: Download editor executable (MacOS)
uses: actions/download-artifact@v3
with:
name: blackjack-macos
path: blackjack_macos
- name: Package the editor zips
run: |
ls -lh
# Package for Windows
mv blackjack_windows blackjack-$RELEASE_VERSION-windows
zip -r blackjack-$RELEASE_VERSION-windows.zip blackjack-$RELEASE_VERSION-windows
# Package for Linux
mv blackjack_linux blackjack-$RELEASE_VERSION-linux
zip -r blackjack-$RELEASE_VERSION-linux.zip blackjack-$RELEASE_VERSION-linux
# Package for MacOS
mv blackjack_macos blackjack-$RELEASE_VERSION-macos
zip -r blackjack-$RELEASE_VERSION-macos.zip blackjack-$RELEASE_VERSION-macos
- name: Download godot plugin Base (Linux)
uses: actions/download-artifact@v3
with:
name: blackjack-godot-base
path: godot_plugin
- name: Download godot plugin Windows dll
uses: actions/download-artifact@v3
with:
name: blackjack-godot-macos-lib
path: godot_plugin/addons/blackjack_engine_godot/
- name: Download godot plugin MacOS dll
uses: actions/download-artifact@v3
with:
name: blackjack-godot-windows-lib
path: godot_plugin/addons/blackjack_engine_godot/
- name: Package the godot plugin
run: |
ls -lh
pushd godot_plugin
zip -r ../blackjack-godot-plugin-$RELEASE_VERSION.zip *
popd
ls -lh
ls -lh godot_plugin
- name: Create a release draft
run: |
gh release create \
--draft \
$RELEASE_VERSION \
blackjack-$RELEASE_VERSION-{windows,linux,macos}.zip \
blackjack-godot-plugin-$RELEASE_VERSION.zip
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}