-
Notifications
You must be signed in to change notification settings - Fork 4
44 lines (41 loc) · 1.33 KB
/
release.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
name: Release
on:
workflow_dispatch:
inputs:
apply:
description: apply. Specify whether the actual release should be performed or not
type: boolean
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_FOR_RELEASE }}
- uses: actions/setup-node@v4
with:
node-version: "20"
check-latest: true
cache: npm
- run: npm ci
- name: Decide the next version
id: version
run: |
latest=$(gh release view --json tagName --jq .tagName)
next=$(echo ${latest#v} | awk -F . '{patch = $3; patch++; printf "%d.%d.%d", $1, $2, patch}')
echo "next=${next}" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Bump the package version
run: |
mv package.json /tmp/
jq '.version = "${{ steps.version.outputs.next }}"' /tmp/package.json | tee package.json
npm i --package-lock-only
- uses: yykamei/actions-git-push@main
with:
commit-message: Bump to ${{ steps.version.outputs.next }}
if: inputs.apply == 'true'
- uses: yykamei/actions-release-actions@main
with:
tag: v${{ steps.version.outputs.next }}
apply: ${{ inputs.apply }}