-
Notifications
You must be signed in to change notification settings - Fork 8
61 lines (50 loc) · 1.63 KB
/
build_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
59
60
61
# ENV needed:
# GIT_TOKEN
# NPM_TOKEN
name: Build & Package
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 */6 * * *'
workflow_dispatch:
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Prepare Upgrade script
run: npm ci
- name: Upgrade
id: upgrade
run: node upgrade.js
continue-on-error: true
- name: Install
run: npm i
if: steps.upgrade.outcome == 'success' && steps.upgrade.conclusion == 'success'
- name: Build
run: npm run build
if: steps.upgrade.outcome == 'success' && steps.upgrade.conclusion == 'success'
- name: Publish on NPM
run: npm publish
if: steps.upgrade.outcome == 'success' && steps.upgrade.conclusion == 'success'
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "Dzeio BOT"
git commit -a -m "bump from remote"
if: steps.upgrade.outcome == 'success' && steps.upgrade.conclusion == 'success'
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GIT_TOKEN }}
branch: ${{ github.ref }}
if: steps.upgrade.outcome == 'success' && steps.upgrade.conclusion == 'success'