-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (40 loc) · 1.19 KB
/
create-version.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
name: Create Version
on:
workflow_dispatch:
inputs:
version:
type: choice
description: major, minor, or patch version
options:
- patch
- minor
- major
env:
NODE_VERSION: 20.x
jobs:
createVersion:
runs-on: ubuntu-22.04
steps:
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Checkout source code
uses: actions/checkout@v3
- name: Install dependencies
run: |
yarn && yarn build
- name: setup git config
run: |
# setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Create new version
run: |
echo "Version: ${{ github.event.inputs.version }}"
npm version ${{ github.event.inputs.version }}
export VERSION_NUMBER=$(node -e "const pkg=require('./package.json'); console.log(pkg.version)")
export VERSION="v${VERSION_NUMBER}"
git push origin
git tag -a "${VERSION}" -m "${VERSION}"
git push origin --tags