1
1
name : Make Release
2
+
3
+ # RELEASE PROCESS
4
+ #
5
+ # === Automated activities ===
6
+ # 1. [Quality check] run unit tests, linting, examples, layer, doc snippets
7
+ # 2. [Release] publish all packages to npmjs.org using the latest git commit, ensure provenance with NPM_CONFIG_PROVENANCE=true
8
+ # 3. [Create tag] create a new git tag using released version, i.e. v1.13.1
9
+ # 4. [Publish layer] build and package layer, kick off the workflow for beta and prod deployment, including canary tests
10
+ # 5. [Publish layer] update documentation with the latest layer ARN version of the prod deployment
11
+ # 6. [Publish layer] create PR to merge the updated documentation
12
+ #
13
+ # === Manual activities ===
14
+ # 1. Kick off `make-version` workflow to bump and review the version changes and changelog for each package
15
+ # 2. Merge the PR created by `make-version` workflow
16
+ # 3. Kick off this workflow to make the release
17
+ # 4. Merge the PR created by the `publish_layer` workflow to update the documentation
18
+ # 5. Update draft release notes with the latest changes and publish the release on GitHub
19
+
2
20
on :
3
21
workflow_dispatch : {}
4
22
@@ -7,9 +25,15 @@ permissions:
7
25
8
26
concurrency :
9
27
group : on-release-publish
28
+
29
+
10
30
jobs :
11
31
run-unit-tests :
12
32
uses : ./.github/workflows/reusable-run-linting-check-and-unit-tests.yml
33
+ # This job publishes the packages to npm.
34
+ # It uses the latest git commit sha as the version and ensures provenance with NPM_CONFIG_PROVENANCE flag.
35
+ # We don't bump the version because we do that in the `make-version` workflow.
36
+ # It also sets the RELEASE_VERSION output to be used by the next job to create a git tag.
13
37
publish-npm :
14
38
needs : run-unit-tests
15
39
# Needed as recommended by npm docs on publishing with provenance https://docs.npmjs.com/generating-provenance-statements
@@ -24,35 +48,47 @@ jobs:
24
48
- name : Checkout code
25
49
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
26
50
with :
27
- # Here `token` is needed to avoid incurring in error GH006 Protected Branch Update Failed,
28
- token : ${{ secrets.GH_PUBLISH_TOKEN }}
29
- # While `fetch-depth` is used to allow the workflow to later commit & push the changes.
30
- fetch-depth : 0
51
+ ref : ${{ github.sha }}
31
52
- name : Setup NodeJS
32
53
uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
33
54
with :
34
55
node-version : " 20"
35
56
cache : " npm"
36
57
- name : Setup auth tokens
37
58
run : |
38
- git config --global user.name 'github-actions[bot]'
39
- git config --global user.email 'github-actions[bot]@users.noreply.github.com'
40
- git remote set-url origin https://x-access-token:${{ secrets.GH_PUBLISH_TOKEN }}@github.com/$GITHUB_REPOSITORY
41
59
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
42
60
- name : Setup dependencies
43
61
uses : ./.github/actions/cached-node-modules
44
- - name : Version
45
- run : |
46
- npx lerna version minor --force-publish --no-commit-hooks --yes
47
62
- name : Publish to npm
48
63
run : |
49
- NPM_CONFIG_PROVENANCE=true npx lerna publish from-git --yes
64
+ NPM_CONFIG_PROVENANCE=true npx lerna publish from-package -- git-head ${{ github.sha }} --yes
50
65
- name : Set release version
51
66
id : set-release-version
52
67
run : |
53
68
VERSION=$(cat lerna.json | jq .version -r)
54
69
echo RELEASE_VERSION="$VERSION" >> "$GITHUB_OUTPUT"
55
-
70
+
71
+ # This job creates a new git tag using the released version (v1.18.1)
72
+ create_tag :
73
+ needs : [publish-npm]
74
+ permissions :
75
+ contents : write
76
+ runs-on : ubuntu-latest
77
+ steps :
78
+ - name : Checkout code
79
+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
80
+ with :
81
+ ref : ${{ github.sha }}
82
+ - name : Git client setup
83
+ run : |
84
+ git config --global user.name 'aws-powertools-bot'
85
+ git config --global user.email '151832416+aws-powertools-bot@users.noreply.github.com'
86
+ git config remote.origin.url >&-
87
+ - name : Create git tag
88
+ run : |
89
+ git tag -a v${{ needs.publish-npm.outputs.RELEASE_VERSION }} -m "Release v${{ needs.publish-npm.outputs.RELEASE_VERSION }}"
90
+ git push origin v${{ needs.publish-npm.outputs.RELEASE_VERSION }}
91
+
56
92
# NOTE: Watch out for the depth limit of 4 nested workflow_calls.
57
93
# publish_layer -> reusable_deploy_layer_stack -> reusable_update_layer_arn_docs
58
94
publish_layer :
0 commit comments