-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (47 loc) · 1.78 KB
/
release-please.yaml
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
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: tibdex/[email protected]
id: get_installation_token
with:
app_id: ${{ secrets.RELEASE_PLEASE_APP_ID }}
installation_id: ${{ secrets.RELEASE_PLEASE_APP_INSTALLATION_ID }}
private_key: ${{ secrets.RELEASE_PLEASE_APP_PRIVATE_KEY }}
- uses: google-github-actions/release-please-action@v3
id: release_please
with:
release-type: go
token: ${{ steps.get_installation_token.outputs.token }}
bump-minor-pre-major: true
package-name: release-please-action
extra-files: |
npm/package.json
- name: Get commit author
id: commit_author
run: |
author=$(gh pr list --search ${{ github.sha }} --state merged --json mergedBy --jq '.[0].mergedBy.login'
echo "author=${author}" >> $$GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ steps.get_installation_token.outputs.token }}
- uses: actions/setup-node@v3
# This sets up the .npmrc file for publishing to npm
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
# we want the good pipefail behaviour https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
- shell: bash
run: |
cd npm
./publish.sh
env:
NPM_TOKEN: ${{ secrets[format('NPM_TOKEN_{0}', steps.commit_author.outputs.author)] || secrets.NPM_TOKEN }}
OPTIC_TOKEN: ${{ secrets[format('OPTIC_TOKEN_{0}', steps.commit_author.outputs.author)] || secrets.OPTIC_TOKEN }}