-
Notifications
You must be signed in to change notification settings - Fork 2
72 lines (61 loc) · 2.76 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
on:
push:
branches:
- main
name: Release Please
jobs:
release-please:
environment: "prod"
permissions:
contents: write # to create release commit (google-github-actions/release-please-action)
pull-requests: write # to create release PR (google-github-actions/release-please-action)
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
token: ${{ secrets.REPO_PAT }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
- name: Checkout code
if: ${{ steps.release.outputs['packages/html/ds--release_created'] || steps.release.outputs['packages/react/ds--release_created'] }}
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.REPO_PAT }}
- name: Use Node.js
if: ${{ steps.release.outputs['packages/html/ds--release_created'] || steps.release.outputs['packages/react/ds--release_created'] }}
uses: actions/setup-node@v4
with:
node-version: 20
- name: Build
if: ${{ steps.release.outputs['packages/html/ds--release_created'] || steps.release.outputs['packages/react/ds--release_created'] }}
run: |
corepack enable
pnpm install --frozen-lockfile --ignore-scripts
pnpm nx affected --base=last-release -t build --parallel=3
- name: Publish packages
if: ${{ steps.release.outputs['packages/html/ds--release_created'] || steps.release.outputs['packages/react/ds--release_created'] }}
run: |
pnpm nx affected --base=last-release -t npm-publish --parallel=1
env:
GITHUB_TOKEN: ${{ secrets.REPO_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish HTML output
if: ${{ steps.release.outputs['packages/html/ds--release_created'] }}
run: gh release upload ${{ steps.release.outputs['packages/html/ds--tag_name'] }} ./packages/html/ds/govie-frontend.zip
env:
GITHUB_TOKEN: ${{ secrets.REPO_PAT }}
- name: Publish Theme output
if: ${{ steps.release.outputs['packages/themes/govie--release_created'] }}
run: gh release upload ${{ steps.release.outputs['packages/themes/govie--tag_name'] }} ./packages/themes/govie/theme.zip
env:
GITHUB_TOKEN: ${{ secrets.REPO_PAT }}
- name: Tag Last Release
if: ${{ steps.release.outputs['packages/html/ds--release_created'] || steps.release.outputs['packages/react/ds--release_created'] }}
run: |
git tag -f last-release
git push origin last-release --force
git checkout latest-release
git rebase origin/main
git push origin --force