-
-
Notifications
You must be signed in to change notification settings - Fork 146
58 lines (55 loc) · 1.66 KB
/
publish.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
name: Publish
#
#
# ~ IMPORTANT ~
# If your commit summary starts with `Release`
# - We will attempt to automatically publish your commit (although, your commit will not be automatically approved)
# - *NOTE*
# - We will attempt to create a new release using the commit description as release notes
#
#
on:
push:
branches:
- main
- master
- experimental
jobs:
publish:
if: startsWith(github.event.head_commit.message, 'Release ')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Publish
run: |
npm install
npm run build
npm run test
npm config set @material-table:registry https://registry.npmjs.org/
npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_AUTH_TOKEN }}
npm publish --ignore-scripts
create-release:
needs: publish
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set env
run: |
RV=$(echo $${{ github.event.head_commit.message }} | awk '{print $NF}')
echo "RELEASE_VERSION=$RV" >> $GITHUB_ENV
echo $RV
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
name: ${{ env.RELEASE_VERSION }}
body: ${{ github.event.head_commit.message }}
draft: false
prerelease: false
generateReleaseNotes: true