-
-
Notifications
You must be signed in to change notification settings - Fork 12
108 lines (105 loc) · 4.47 KB
/
build.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
# This is a basic workflow to help you get started with Actions
name: CI
on:
push:
branches: [ release ]
workflow_dispatch:
branches: [ release ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Setup Build Variables
id: buildvars
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
try {
const package = require(`${process.env.GITHUB_WORKSPACE}/package.json`);
['name', 'version', 'description', 'author']
.forEach(k => core.setOutput(k, package[k]));
const tagVersion = package.version.replace(/\./g, '');
core.setOutput('tagversion', tagVersion);
core.setOutput('tagname', `${package.name}-${tagVersion}`);
core.setOutput('releasename', `${package.description} Release v${package.version}`);
} catch (err) {
core.setFailed(err.message);
}
- name: Install Dependencies
run: npm install
- name: Build project
run: npm run build
- name: Pack bundles
run: npm run pack
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.buildvars.outputs.tagname }}
release_name: ${{ steps.buildvars.outputs.releasename }}
draft: false
prerelease: false
- name: Upload Release Addons Src
id: upload-release-addons-src
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/bundles/halloween-mod-${{ steps.buildvars.outputs.tagversion }}-addons-src.zip
asset_name: halloween-mod-${{ steps.buildvars.outputs.tagversion }}-addons-src.zip
asset_content_type: application/zip
- name: Upload Release Addons
id: upload-release-addons
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/bundles/halloween-mod-${{ steps.buildvars.outputs.tagversion }}-addons.zip
asset_name: halloween-mod-${{ steps.buildvars.outputs.tagversion }}-addons.zip
asset_content_type: application/zip
- name: Upload Release Addons ReAPI
id: upload-release-addons-reapi
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/bundles/halloween-mod-${{ steps.buildvars.outputs.tagversion }}-addons-reapi.zip
asset_name: halloween-mod-${{ steps.buildvars.outputs.tagversion }}-addons-reapi.zip
asset_content_type: application/zip
- name: Upload Release Resources
id: upload-release-resources
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/bundles/halloween-mod-${{ steps.buildvars.outputs.tagversion }}-resources.zip
asset_name: halloween-mod-${{ steps.buildvars.outputs.tagversion }}-resources.zip
asset_content_type: application/zip
- name: Upload Release SDK
id: upload-release-sdk
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/bundles/halloween-mod-${{ steps.buildvars.outputs.tagversion }}-sdk.zip
asset_name: halloween-mod-${{ steps.buildvars.outputs.tagversion }}-sdk.zip
asset_content_type: application/zip
- name: Cleanup
run: |
rm -rf ./compiler
rm -rf ./thirdparty
rm -rf ./dist
rm -rf ./downloads