-
-
Notifications
You must be signed in to change notification settings - Fork 17
199 lines (168 loc) · 8.99 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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
name: Release
on:
push:
tags:
- "v*.*.*"
branches:
- feat/workflow
paths-ignore:
- "README.md"
- "docs/**"
- ".all-contributorsrc"
jobs:
skip:
runs-on: ubuntu-latest
if: |
!contains(format('{0} {1} {2}', github.event.head_commit.message, github.event.pull_request.title, github.event.pull_request.body), 'skip ci')
steps:
- run: |
cat <<'MESSAGE'
github.event_name: ${{ toJson(github.event_name) }}
github.event:
${{ toJson(github.event) }}
MESSAGE
build:
needs: skip
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019]
steps:
##########################################################################################
# Checkout
- name: Checkout
uses: actions/[email protected]
with:
lfs: true
##########################################################################################
# Setup SDK
- name: Checkout Build Tools
uses: actions/[email protected]
with:
repository: flashflashrevolution/rCubed-build-tools
path: "tools"
lfs: true
- name: Extract Air SDK [32.0]
if: matrix.os == 'windows-2019'
run: 7z.exe x -tzip ${{ github.workspace }}\tools\SDK-Lite.zip -o${{ github.workspace }}\airsdk
- name: Extract Runtimes
if: matrix.os == 'windows-2019'
run: 7z.exe x -tzip ${{ github.workspace }}\tools\Runtimes.zip -o${{ github.workspace }}\bundles
- name: Install Dependencies (asconfigc)
run: npm install asconfigc
##########################################################################################
# Set build version.
- name: Get Numerical Version Number from Tag
if: startsWith(github.ref, 'refs/tags')
shell: bash
id: versionNumber
run: echo ::set-output name=tag::$(echo ${GITHUB_REF/refs\/tags\/v/} | sed -r 's/([0-9]+\.[0-9]+\.[0-9]+)-.*/\1/' )
- name: Generate Date
shell: bash
id: datestamp
run: echo ::set-output name=date::$(date +'%Y-%m-%d')
# Set build version.
- name: Token Replace in asconfig
uses: cschleiden/replace-tokens@v1
with:
files: '["asconfig.release.json"]'
env:
SCORE_SAVE_SALT: ${{ secrets.SCORE_SAVE_SALT }}
VERSION: ${{ steps.versionNumber.outputs.tag }}
DATESTAMP: ${{ steps.datestamp.outputs.date }}
- name: Token Replace in runtimes
uses: cschleiden/replace-tokens@v1
with:
files: '["bundles/**/application.xml"]'
env:
VERSION: ${{ steps.versionNumber.outputs.tag }}
##########################################################################################
# Import Branding
- name: Import Branding SWC Library
uses: RollyPeres/base64-to-path@v1
with:
filePath: ${{ github.workspace }}\libs\assets\branding.swc
encodedString: ${{ secrets.BRANDING_SWC }}
##########################################################################################
# Build SWFs
- name: Build Embedded Fonts Library [Windows]
if: matrix.os == 'windows-2019'
shell: cmd
run: ${{ github.workspace }}\node_modules\.bin\asconfigc.cmd --sdk ${{ github.workspace }}\airsdk --project ${{ github.workspace }}/fonts/asconfig.embed-fonts.json --verbose
- name: Build the Game (Normal) [Windows]
if: matrix.os == 'windows-2019'
shell: cmd
run: ${{ github.workspace }}\node_modules\.bin\asconfigc.cmd --sdk ${{ github.workspace }}\airsdk --project asconfig.release.json --verbose
- name: Build the Game (Hybrid) [Windows]
if: matrix.os == 'windows-2019'
shell: cmd
run: ${{ github.workspace }}\node_modules\.bin\asconfigc.cmd --sdk ${{ github.workspace }}\airsdk --project asconfig.hybrid.json --verbose
##########################################################################################
# Package Version 64-bit
- name: Copy Changelog (64-bit)
run: Copy-Item "${{ github.workspace }}\changelog.txt" -Destination "${{ github.workspace }}\bundles\64bit"
- name: Copy Game (64-bit)
run: Copy-Item "${{ github.workspace }}\bin\release\R3Air.swf" -Destination "${{ github.workspace }}\bundles\64bit"
- name: Rename Release Folder (64-bit)
run: Rename-Item -Path "${{ github.workspace }}\bundles\64bit" -NewName "R3Air.${{ steps.versionNumber.outputs.tag }}.Release.64"
- name: Package Build in Zip (64-bit)
run: 7z.exe a -tzip -mx=9 ${{ github.workspace }}\bundles\64bit.zip ${{ github.workspace }}\bundles\R3Air.${{ steps.versionNumber.outputs.tag }}.Release.64
# Package Version 32-bit
- name: Copy Changelog (32-bit)
run: Copy-Item "${{ github.workspace }}\changelog.txt" -Destination "${{ github.workspace }}\bundles\32bit"
- name: Copy Game (32-bit)
run: Copy-Item "${{ github.workspace }}\bin\release\R3Air.swf" -Destination "${{ github.workspace }}\bundles\32bit"
- name: Rename Release Folder (32-bit)
run: Rename-Item -Path "${{ github.workspace }}\bundles\32bit" -NewName "R3Air.${{ steps.versionNumber.outputs.tag }}.Release.32"
- name: Package Build in Zip (32-bit)
run: 7z.exe a -tzip -mx=9 ${{ github.workspace }}\bundles\32bit.zip ${{ github.workspace }}\bundles\R3Air.${{ steps.versionNumber.outputs.tag }}.Release.32
# Package Version Hybrid
- name: Copy Changelog (Hybrid)
run: Copy-Item "${{ github.workspace }}\changelog.txt" -Destination "${{ github.workspace }}\bundles\Hybrid"
- name: Copy Game (Hybrid)
run: Copy-Item "${{ github.workspace }}\bin\release\air.swf" -Destination "${{ github.workspace }}\bundles\Hybrid"
- name: Rename Release Folder (Hybrid)
run: Rename-Item -Path "${{ github.workspace }}\bundles\Hybrid" -NewName "R3Air.0.0.8+${{ steps.versionNumber.outputs.tag }}"
- name: Package Build in Zip (32-bit)
run: 7z.exe a -tzip -mx=9 ${{ github.workspace }}\bundles\Hybrid.zip ${{ github.workspace }}\bundles\R3Air.0.0.8+${{ steps.versionNumber.outputs.tag }}
##########################################################################################
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.versionNumber.outputs.tag }}
release_name: rCubed - v${{ steps.versionNumber.outputs.tag }}
draft: true
prerelease: true
- name: Upload ZIP (64-bit)
id: upload-zip-release-64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}\bundles\64bit.zip
asset_name: rCubed-${{ steps.versionNumber.outputs.tag }}-64bit.zip
asset_content_type: application/executable
- name: Upload ZIP (32-bit)
id: upload-zip-release-32
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}\bundles\32bit.zip
asset_name: rCubed-${{ steps.versionNumber.outputs.tag }}-32bit.zip
asset_content_type: application/executable
- name: Upload ZIP (Hybrid)
id: upload-zip-release-hybrid
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}\bundles\Hybrid.zip
asset_name: rCubed-0.0.8-${{ steps.versionNumber.outputs.tag }}-Hybrid-32bit.zip
asset_content_type: application/executable