-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.01 KB
/
release.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
name: Release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
outputs:
new_tag_version: ${{ steps.create_release.outputs.new_release_tag }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Build the project
run: npm run build
- name: Dry Run
id: tag_version
run: |
export NEW_TAG_VERSION=$(npx semantic-release --dry-run | grep "The next release version is" | awk '{print $6}')
echo "new_tag_version=$NEW_TAG_VERSION" >> $GITHUB_ENV
- name: Generate Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release