-
-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (64 loc) · 2.65 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
# 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: Install Dependencies
run: npm install
- name: Build project
run: npm run build
- name: Pack bundles
run: npm run pack
- name: Setup Release Variables
id: release_vars
uses: actions/github-script@v6
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('bundlename', `${package.name}-${tagVersion}`);
core.setOutput('tagname', `${package.name}-${tagVersion}`);
core.setOutput('releasename', `${package.description} Release v${package.version}`);
const bundles_metadata = require(`${process.env.GITHUB_WORKSPACE}/dist/bundles/files.json`);
core.setOutput('srcArchive', bundles_metadata.srcArchive);
core.setOutput('buildArchive', bundles_metadata.buildArchive);
core.setOutput('resourcesArchive', bundles_metadata.resourcesArchive);
core.setOutput('sdkArchive', bundles_metadata.sdkArchive);
} catch (err) {
core.setFailed(err.message);
}
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ steps.release_vars.outputs.releasename }}
tag_name: ${{ steps.release_vars.outputs.tagname }}
draft: false
prerelease: false
files: |
./dist/bundles/${{ steps.release_vars.outputs.srcArchive }}
./dist/bundles/${{ steps.release_vars.outputs.buildArchive }}
./dist/bundles/${{ steps.release_vars.outputs.resourcesArchive }}
./dist/bundles/${{ steps.release_vars.outputs.sdkArchive }}
- name: Cleanup
run: |
rm -rf ./.compiler
rm -rf ./.thirdparty
rm -rf ./dist