-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (57 loc) · 1.61 KB
/
release.yml
File metadata and controls
70 lines (57 loc) · 1.61 KB
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
name: Auto release
on:
push:
branches:
- main
permissions:
contents: write
packages: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "16.x"
- name: Install dependencies
run: npm install
- name: Configure Git user
run: |
git config --global user.name "parsa"
git config --global user.email "parsabr80@gmail.com"
- name: Bump version using standard-version
run: npx standard-version
- name: Push changes
run: git push --follow-tags origin main
- name: Build the project
run: npm run build
- name: Zip dist folder
run: |
zip -r $GITHUB_WORKSPACE/output.zip dist/
echo "output.zip created"
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Generate tag name from package.json
id: generate_tag
run: |
VERSION=$(jq -r ".version" package.json)
echo "TAG_NAME=v$VERSION" >> $GITHUB_ENV
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: "Release ${{ env.TAG_NAME }}"
body: ${{ github.event.head_commit.message }}
draft: false
prerelease: false