-
-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (48 loc) · 1.51 KB
/
release-trigger.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
56
57
58
59
60
name: Trigger release
on:
workflow_dispatch:
inputs:
version:
description: 'Version to bump to'
required: false
jobs:
prepare-verify-trigger:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.SP_CI_AT }}
- name: Setup NodeJS 14
uses: actions/setup-node@v2
with:
node-version: 14
- name: Install NPM
run: npm install
- name: Bump to target version, if any
if: ${{ github.event.inputs.version }}
run: npm run bump -- --version=${{ github.event.inputs.version }}
- name: Bump release version
run: |
npm run bump -- --release
echo "RELEASE_VERSION=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
# Build & Verify new version
- name: Build
run: npm run build
- name: Lint
run: npm run lint
- name: Test
run: npm run test
# Push updated content to remote and Tag version
- name: Push changes
run: |
git fetch
git config user.email "gullerya@gmail.com"
git config user.name "sign-pad CI"
git add --all
git commit -m "set version to ${{ env.RELEASE_VERSION }}"
git push origin HEAD:main
- name: Tag release
run: |
git tag -a v${{ env.RELEASE_VERSION }} -m "tag release v${{ env.RELEASE_VERSION }}"
git push origin HEAD:main v${{ env.RELEASE_VERSION }}