-
Notifications
You must be signed in to change notification settings - Fork 7
42 lines (36 loc) · 1.06 KB
/
publish.yaml
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
name: Publish package to NPM
on:
workflow_dispatch:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Publish package to NPM
id: publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Log update
if: steps.publish.outputs.type != 'none'
run: |
echo Successfully published a new version
echo "${{ steps.publish.outputs.type }} update: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}"
github-release:
runs-on: ubuntu-latest
needs: publish
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get package version
run: echo "LATEST_TAG=$(jq -r .version package.json)" >> $GITHUB_ENV
- name: Create Github release
uses: ncipollo/release-action@v1
with:
tag: 'v${{ env.LATEST_TAG }}'
generateReleaseNotes: true