-
-
Notifications
You must be signed in to change notification settings - Fork 45
55 lines (53 loc) · 1.72 KB
/
deploy.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
name: Release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
release:
permissions:
contents: write
pull-requests: write
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- name: Get variables
id: version
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
- name: Setup node
uses: actions/[email protected]
with:
node-version: '22.11.0'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install
- name: Update package.json version
run: npm version ${{ steps.version.outputs.version }} --no-git-tag-version --allow-same-version
- name: Commit package.json
run: |
if [[ `git status --porcelain` ]]; then
git config user.email "[email protected]"
git config user.name "dev-yakuza"
git add .
git commit -m "chore: Release v${{ steps.version.outputs.version }}"
git push origin HEAD:main -f
git tag ${{ steps.version.outputs.version }} -f
git push origin ${{ steps.version.outputs.version }} -f
fi
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# For release notes
- uses: release-drafter/release-drafter@v6
with:
tag: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.version }}
version: ${{ steps.version.outputs.version }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}