forked from samcorcos/apple-pay-decrypt
-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (61 loc) · 1.74 KB
/
publish-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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Publish Github
on:
push:
paths:
- 'package.json'
- 'package-lock.json'
branches:
- master
pull_request:
paths:
- 'package.json'
- 'package-lock.json'
branches:
- master
jobs:
check-packages-github:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
outputs:
continue: ${{ steps.check.outputs.continue }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://npm.pkg.github.com'
- name: Check packages where versions were changed
id: check
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ${{ github.workspace }}/.github/workflows/check-versions.sh
publish-github:
needs: check-packages-github
if: ${{ needs.check-packages-github.outputs.continue == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://npm.pkg.github.com'
cache: 'yarn'
- name: Install dependencies
run: yarn
- name: Publish Release
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm publish
- name: Publish Pre-Release
if: ${{ github.event_name == 'pull_request' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |-
version=$(jq -r '.version' package.json)
pre_release=$(echo $version | cut -f2 -sd-)
if [[ ! -z "$pre_release" ]]; then
npm publish --tag dev
fi