This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 379
97 lines (85 loc) · 3.06 KB
/
release-please.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
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release Please
on:
push:
branches:
- main
jobs:
release-please:
name: Release
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
published: ${{ steps.set_outputs.outputs.published }}
release: ${{ steps.set_outputs.outputs.release }}
changelog: ${{ steps.set_outputs.outputs.changelog }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
token: ${{ secrets.GH_ZAPPER_BOT }}
package-name: '@zapper-fi/studio'
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v2
with:
node-version: 'lts/hydrogen'
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
if: ${{ steps.release.outputs.release_created }}
- uses: pnpm/[email protected]
with:
version: 8.6.6
run_install: true
if: ${{ steps.release.outputs.release_created }}
- name: Build package
env:
NODE_OPTIONS: '--max_old_space_size=8192'
run: pnpm build
if: ${{ steps.release.outputs.release_created }}
- name: Publish to Github Packages
working-directory: dist
run: |
echo "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}" > .npmrc
npm config set registry https://npm.pkg.github.com
npm publish --no-git-checks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
- name: Fetch Release
id: fetch-latest-release
uses: gregziegan/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
- name: Set Outputs
id: set_outputs
run: |
echo "::set-output name=published::${{ steps.release.outputs.release_created }}"
echo "::set-output name=release::${{ steps.fetch-latest-release.outputs.name }}"
echo "::set-output name=changelog::${{ steps.fetch-latest-release.outputs.body }}"
if: ${{ steps.release.outputs.release_created }}
bump-zapper-api:
name: Bump on Zapper API
needs: [release-please]
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.published == 'true' }}
steps:
- uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.GH_ZAPPER_BOT }}
repository: zapper-fi/zapper-api
event-type: bump-studio
client-payload: '{"release": "${{ needs.release-please.outputs.release }}", "changelog": "${{ needs.release-please.outputs.changelog }}"}'