-
Notifications
You must be signed in to change notification settings - Fork 15
51 lines (48 loc) · 1.47 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
48
49
50
# Very important!
# Make sure that the github token has read AND WRITE access on github.
# 1. hit https://github.com/seatsio/[REPO]/settings/actions
# 2. under "Workflow permissions", make sure "Read and write permissions" is checked instead of the (default?) read only.
#
name: Release
run-name: Release ${{ github.repository }}
on:
workflow_dispatch:
inputs:
versionToBump:
description: 'The version to bump. Major for incompatible API changes, minor for adding BC features'
required: true
type: choice
options:
- minor
- major
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: fregante/setup-git-user@v2
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: yarn install
- run: yarn zx ./release.mjs -v $VERSION_TO_BUMP
env:
VERSION_TO_BUMP: ${{ inputs.versionToBump }}
GH_TOKEN: ${{ github.token }}
- run: yarn build
- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
notify-slack-failure:
runs-on: ubuntu-latest
needs: [ release ]
if: failure()
steps:
- uses: voxmedia/github-action-slack-notify-build@v2
with:
status: FAILED
channel: build_status
color: danger
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}