-
-
Notifications
You must be signed in to change notification settings - Fork 20
42 lines (35 loc) · 1.34 KB
/
deploy-release-to-npm.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
name: Deploy release to NPM
on:
release:
types: [published]
jobs:
publish-to-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: '18.x'
# Enables caching Yarn dependencies (uses https://github.com/actions/cache under the hood)
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
always-auth: true
- name: Install dependencies
run: yarn install --frozen-lockfile
# Make sure you have bumped the version before publishing the release
# This script will not bump the version and will use the version from package.json
# It will just fail if trying to publish an already published version
- name: Build and publish the package
run: yarn publish --non-interactive --new-version ${{ github.event.release.tag_name }} --no-git-tag-version
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Commit files
run: |
git add package.json
git commit -m "chore: Release ${{ github.event.release.tag_name }}"
git push origin master