-
Notifications
You must be signed in to change notification settings - Fork 58
47 lines (43 loc) · 1.17 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
45
46
47
name: Release
on:
workflow_dispatch:
inputs:
version:
description: Released version
type: string
required: true
jobs:
show-context:
runs-on: ubuntu-latest
steps:
- name: Show github context object
run: echo $JSON
env:
JSON: ${{ toJSON(github) }}
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure git
run: |
git config --global user.name "Tomohiko Ozawa"
git config --global user.email "kota65535@gmail.com"
- name: Get major version
run: |
set -x
echo "MAJOR_VERSION=$(perl -ne 'print $1 if /^(.*?)\.(.*?)\.(.*?)$/' <<< '${{ github.event.inputs.version }}')" >> $GITHUB_ENV
- name: Run npm version
run: |
set -x
npm version ${{ inputs.version }}
- name: Update the major version tag
run: |
set -x
git tag -f v${{ env.MAJOR_VERSION }}
- name: Push the version commit and tags
run: |
set -x
git pull --rebase
git push origin HEAD
git push -f --tags