-
Notifications
You must be signed in to change notification settings - Fork 9
42 lines (34 loc) · 1.03 KB
/
02_publish_to_github.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: Publish Github Package
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@almond-bongbong'
- name: Install dependencies
run: yarn install
- name: Build package
run: yarn build
- name: Install jq
run: sudo apt-get install -y jq
- name: Update package.json for GitHub Packages
run: |
jq '.name = "@almond-bongbong/react-simple-toasts"' package.json > package.temp.json
mv package.temp.json package.json
- name: Publish to GitHub Packages
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}