-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (44 loc) · 1.26 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
46
47
48
49
50
51
52
on:
create:
tags:
- v*
schedule:
- cron: "0 0 1 */2 *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: |
CI=false yarn install
- name: Yarn bump patch
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: |
git config user.email "[email protected]"
git config user.name "git.action"
echo "ref=$(yarn version --patch --json|grep -o '[0-9.]*'|tail -1)" >> "$GITHUB_ENV"
- name: Build
run: |
CI=false yarn build
- name: Zip build
run: |
zip -r build.zip build/
- name: Create Release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ env.ref || github.ref }}
# release_name: Release ${{ github.ref }}
body: "Build for commit : ${{ github.event.head_commit.message || 'automatic' }}" # TODO: changelog, and build only on tag
draft: false
prerelease: false
artifact: "build.zip"