Skip to content

Commit be59df9

Browse files
authored
Merge pull request #1026 from brendandburns/release
Improve release github action.
2 parents 6b42a07 + 43be054 commit be59df9

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@ name: Release
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
releaseVersion:
7+
type: string
8+
required: true
9+
description: The version of this release. Must be a semantic version of the form X.Y.Z.
10+
dry_run:
11+
type: boolean
12+
required: true
13+
default: false
14+
description: Dry run, will not push branches or upload the artifacts.
15+
skip_tag:
16+
type: boolean
17+
required: true
18+
default: false
19+
description: If true, don't tag this release, just push it.
520

621
jobs:
722
release:
@@ -20,6 +35,17 @@ jobs:
2035
- name: Package
2136
run: ./build-package.sh
2237
- name: Upload
38+
if: ${{ github.event.inputs.dry_run != 'true' }}
2339
run: npm publish
2440
env:
2541
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
42+
- name: Tag release
43+
if: ${{ github.event.inputs.skip_tag != 'true' }}
44+
run: |
45+
git config --global user.name 'Github Bot'
46+
git config --global user.email '<>'
47+
git tag -a ${{ github.events.inputs.version }}
48+
- name: Push tag
49+
if: ${{ github.event.inputs.dry_run != 'true' }}
50+
run: |
51+
git push ${{ github.events.inputs.version }}

0 commit comments

Comments
 (0)