-
Notifications
You must be signed in to change notification settings - Fork 28
56 lines (53 loc) · 1.42 KB
/
build_packages.yaml
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
name: build packages
on:
pull_request:
push:
tags:
- "*"
branches:
- "master"
- "dev/*"
jobs:
build:
runs-on: ubuntu-20.04
container: node:10.18
steps:
- uses: actions/checkout@v2
- name: install zip
run: apt-get update && apt-get install -y zip
- name: build
run: |
yarn
yarn build
- name: create package
run: |
touch dist/version
echo "github_ref: $GITHUB_REF" >> dist/version
echo "github_sha: $GITHUB_SHA" >> dist/version
zip -rq emqx-dashboard.zip ./dist
- uses: actions/upload-artifact@v2
with:
name: emqx-dashboard
path: dist/
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: EMQX Dashboard ${{ github.ref }} Released
draft: false
prerelease: false
- name: Upload Release Asset
if: startsWith(github.ref, 'refs/tags/')
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./emqx-dashboard.zip
asset_name: emqx-dashboard.zip
asset_content_type: application/zip