-
Notifications
You must be signed in to change notification settings - Fork 11
67 lines (65 loc) · 2.73 KB
/
Copy pathlibrary-release.yml
File metadata and controls
67 lines (65 loc) · 2.73 KB
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
name: Library Release
on:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Load secrets
id: load-secrets
uses: 1password/load-secrets-action@v3.0.0
with:
export-env: false
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
GPG_PASSPHRASE: op://kv_gov-ui-kit_infra/arabot-1_SIGN_CERTS/credential
GPG_PRIVATE_KEY: op://kv_gov-ui-kit_infra/arabot-1_SIGN_CERTS/private_key
ARABOT_PAT_TRIGGER_WORKFLOW: op://kv_gov-ui-kit_infra/GITHUB_PAT/credential
- name: Setup
uses: aragon/gov-ui-kit/.github/actions/setup@main
with:
token: ${{ steps.load-secrets.outputs.ARABOT_PAT_TRIGGER_WORKFLOW }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6.3.0
with:
gpg_private_key: ${{ steps.load-secrets.outputs.GPG_PRIVATE_KEY }}
passphrase: ${{ steps.load-secrets.outputs.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Update version and changelog
# Run prettier on CHANGELOG.md file (used for Github release notes) to remove automatic formatting applied by
# changeset as Github does not support soft line breaks.
# (See https://github.com/changesets/changesets/issues/1452, https://github.com/orgs/community/discussions/10981)
run: |
yarn changeset version
yarn prettier --write CHANGELOG.md --print-width 9999999 --ignore-path
env:
GITHUB_TOKEN: ${{ steps.load-secrets.outputs.ARABOT_PAT_TRIGGER_WORKFLOW }}
- name: Create tag
run: yarn changeset tag
- name: Get package version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: Commit changes
run: |
git add --all
git commit -am "Publish v${{ steps.package-version.outputs.current-version}}"
git push --follow-tags
- name: Read changelog updates
id: read-changelog
uses: actions/github-script@v8.0.0
env:
version: "${{ steps.package-version.outputs.current-version }}"
path: ./CHANGELOG.md
with:
script: |
const readChangelog = require('./.github/workflows/scripts/readChangelog.js');
readChangelog({ github, context, core });
- name: Create release
uses: softprops/action-gh-release@v2.3.3
with:
prerelease: false
tag_name: "v${{ steps.package-version.outputs.current-version}}"
body: ${{ steps.read-changelog.outputs.changes }}
token: ${{ steps.load-secrets.outputs.ARABOT_PAT_TRIGGER_WORKFLOW }}