-
-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·89 lines (73 loc) · 2.54 KB
/
release-master.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
on:
push:
branches:
- master
permissions:
contents: write
pull-requests: write
name: 📦 Create New Release
jobs:
checks:
name: ✅ Check for Release
runs-on: ubuntu-latest
timeout-minutes: 15
env:
HUSKY: 0
steps:
- name: 📀 Check out code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: 🧪 Check out repository code
uses: ./.github/workflows/health-check
release:
name: 📦 Release Version
runs-on: ubuntu-latest
timeout-minutes: 60
needs:
- checks
env:
HUSKY: 0
steps:
- name: 📀 Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 🗃️ Install Node.js Deps
run: |
npm install --legacy-peer-deps
- name: Create a new version, update CHANGELOG.md
run: |
git config --global user.email "github-actions[bot]@gmail.com"
git config --global user.name "github-actions[bot]"
npx standard-version
git push --follow-tags origin master
- name: 🔨 Build Package
run: |
npm run pack
- name: 🤐 Archive pack file
uses: thedoctor0/zip-release@master
with:
path: ./bin/*
filename: pack.zip
- name: Extract version from package.json
id: get_version
run: |
echo "::set-output name=version::$(jq -r '.version' package.json)"
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.get_version.outputs.version }}
release_name: v${{ steps.get_version.outputs.version }}
- name: 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: ./pack.zip
asset_name: cli-v${{ steps.get_version.outputs.version }}.zip
asset_content_type: application/zip