-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (38 loc) · 1.05 KB
/
main.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
name: Build
on:
push:
tags:
- '1.*.*'
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Yarn Build
run: |
echo install yarn...
yarn version
yarn install
yarn build
tar -czf release-${{ env.RELEASE_VERSION }}.tar.gz build
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: release-${{ env.RELEASE_VERSION }}
path: release-${{ env.RELEASE_VERSION }}.tar.gz
- name: Make Release
uses: softprops/action-gh-release@v0.1.5
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
release-${{ env.RELEASE_VERSION }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}