-
Notifications
You must be signed in to change notification settings - Fork 8
51 lines (48 loc) · 1.57 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
# 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: 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'