-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (42 loc) · 1.38 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
name: Release
on:
workflow_dispatch:
inputs:
versionType:
description: version type increment (major | minor | patch)
required: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
name: Generate app token
with:
app-id: ${{ vars.GRIDSUITE_ACTIONS_APPID }}
private-key: ${{ secrets.GRIDSUITE_ACTIONS_SECRET }}
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Add release commit and publish
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
npm version ${{ github.event.inputs.versionType }}
git push origin main
git push origin $(git tag --points-at HEAD)
npm install
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub release
run: |
gh release create $(git tag --points-at HEAD) --generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}