-
Notifications
You must be signed in to change notification settings - Fork 10
85 lines (82 loc) · 2.49 KB
/
release.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: "Release"
on:
workflow_dispatch:
inputs:
dryRun:
description: "Do a dry run to preview instead of a real release [true/false]"
required: true
default: "false"
jobs:
semantic-release:
name: "Semantic Release"
runs-on: macos-latest
env:
GITHUB_TOKEN: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }}
GIT_AUTHOR_NAME: mparticle-bot
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: mparticle-bot
GIT_COMMITTER_EMAIL: [email protected]
steps:
- name: "Checkout public main branch"
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: main
# - name: "Import GPG Key"
# uses: crazy-max/ghaction-import-gpg@v4
# with:
# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
# passphrase: ${{ secrets.GPG_PASSPHRASE }}
# git_user_signingkey: true
# git_commit_gpgsign: true
- name: "Semantic Release --dry-run"
if: ${{ github.event.inputs.dryRun == 'true' }}
run: |
npx \
-p lodash \
-p semantic-release@17 \
-p @semantic-release/changelog@5 \
-p @semantic-release/git@9 \
-p @semantic-release/exec@5 \
semantic-release --dry-run
- name: "Semantic Release"
if: ${{ github.event.inputs.dryRun == 'false' }}
run: |
npx \
-p lodash \
-p semantic-release@17 \
-p @semantic-release/changelog@5 \
-p @semantic-release/git@9 \
-p @semantic-release/exec@5 \
semantic-release
- name: "Push automated release commits to release branch"
if: ${{ github.event.inputs.dryRun == 'false' }}
run: |
git push origin main
npm-release:
name: "Upload to NPM"
runs-on: ubuntu-latest
needs: semantic-release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
defaults:
run:
working-directory: ./plugin
steps:
- name: "Checkout public main branch"
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: main
- name: "Install Node"
uses: actions/setup-node@v1
- name: "NPM Build"
run: |
npm ci
npm run build --if-present
- name: "Upload to NPM"
if: ${{ github.event.inputs.dryRun == 'false' }}
run: |
touch .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
npm publish