-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (47 loc) · 1.34 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
name: Publish NPM Package
on:
push:
branches:
- main
permissions:
contents: write
packages: write
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
registry-url: 'https://npm.pkg.github.com'
scope: '@hlexnc'
- name: Install dependencies
run: npm install
working-directory: officegen-api/
- name: Publish package
id: publish
run: npm publish
working-directory: officegen-api/
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Increment package version
if: steps.publish.outcome == 'failure'
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git pull origin
npm version patch
git add .
git commit -m "chore: bump version [skip ci]"
git push
working-directory: officegen-api/
- name: Publish package again
if: steps.publish.outcome == 'failure'
run: npm publish
working-directory: officegen-api/
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}