-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (43 loc) · 1.29 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
name: Npm - Publish (GitHub Registry)
on:
workflow_call:
secrets:
github-token:
description: 'The GitHub PAT token to perform checkout and publish.'
required: true
jobs:
build:
runs-on: ubuntu-latest
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.github-token }}
steps:
- name: 🛎 Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.github-token }}
- name: 🟩 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 14
registry-url: https://npm.pkg.github.com/
scope: '@unosquare'
cache: 'npm'
- name: 🤠 npm install
run: npm ci
- name: 🏗 Build
run: npm run build
- name: 🐝 Bump version
run: npm version --no-git-tag-version ${{ github.ref == 'refs/heads/dev' && 'patch' || 'minor' }}
- name: 🤡 Publish
run: |
rm ./dist/package.json
mv ./dist/src/* ./dist/
echo "//registry.npmjs.org/:_authToken=${{ secrets.github-token }}" > ~/.npmrc
npm publish
- name: 📌 Commit
uses: EndBug/add-and-commit@v9
with:
message: '[skip ci] Bump version'
env:
GITHUB_TOKEN: ${{ secrets.github-token }}