-
Notifications
You must be signed in to change notification settings - Fork 2
108 lines (95 loc) · 4.73 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
98
99
100
101
102
103
104
105
106
107
108
on:
push:
branches:
- main
name: Release Please
jobs:
release-please:
environment: "prod"
runs-on: ubuntu-latest
permissions:
contents: write # to create release commit (googleapis/release-please-action)
pull-requests: write # to create release PR (googleapis/release-please-action)
outputs:
storybook_html_released: ${{ steps.publish-outputs.outputs.storybook_html_released }}
storybook_react_released: ${{ steps.publish-outputs.outputs.storybook_react_released }}
docs_released: ${{ steps.publish-outputs.outputs.docs_released }}
steps:
- uses: googleapis/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'] || steps.release.outputs['packages/themes/govie--release_created'] || steps.release.outputs['tokens--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'] || steps.release.outputs['packages/themes/govie--release_created'] || steps.release.outputs['tokens--release_created'] }}
uses: actions/setup-node@v4
with:
node-version: 22
- name: Build
if: ${{ steps.release.outputs['packages/html/ds--release_created'] || steps.release.outputs['packages/react/ds--release_created'] || steps.release.outputs['packages/themes/govie--release_created'] || steps.release.outputs['tokens--release_created'] }}
run: |
corepack enable
pnpm install --frozen-lockfile --ignore-scripts
pnpm build
- name: Publish DS React package
if: ${{ steps.release.outputs['packages/react/ds--release_created'] }}
run: |
pnpm --filter "@govie-ds/react" publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Theme GOV.IE design tokens package
if: ${{ steps.release.outputs['tokens--release_created'] }}
run: |
pnpm --filter "@govie-ds/tokens" publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Tailwind Builder package
if: ${{ steps.release.outputs['packages/design/tailwind--release_created'] }}
run: |
pnpm --filter "@govie-ds/tailwind" publish
env:
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: |
pnpm --filter "@govie-ds/theme-govie" publish
gh release upload ${{ steps.release.outputs['packages/themes/govie--tag_name'] }} ./packages/themes/govie/theme.zip
env:
GITHUB_TOKEN: ${{ secrets.REPO_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Tag Last Release
if: ${{ steps.release.outputs['packages/html/ds--release_created'] || steps.release.outputs['packages/react/ds--release_created'] || steps.release.outputs['packages/themes/govie--release_created'] || steps.release.outputs['tokens--release_created'] || steps.release.outputs['apps/docs--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
- name: Publish outputs
id: publish-outputs
run: |
echo "storybook_html_released=${{ steps.release.outputs['packages/html/ds--release_created'] }}" >> $GITHUB_OUTPUT
echo "storybook_react_released=${{ steps.release.outputs['packages/react/ds--release_created'] }}" >> $GITHUB_OUTPUT
echo "docs_released=${{ steps.release.outputs['apps/docs--release_created'] }}" >> $GITHUB_OUTPUT
deploy-docs-aws:
needs: release-please
if: ${{ needs.release-please.outputs.docs_released == 'true' }}
uses: ./.github/workflows/deploy-docs-aws.yml
with:
env: prod
secrets:
REPO_PAT: ${{ secrets.REPO_PAT }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}