Skip to content

Commit 783bf01

Browse files
authored
chore: Fix release job by doing all builds in step 1 and only download and publish in subsequent steps (#448)
1 parent 71c6a05 commit 783bf01

File tree

2 files changed

+30
-59
lines changed

2 files changed

+30
-59
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release
1+
name: Release (Requires manual steps to take)
22
on: workflow_dispatch
33
jobs:
44
release:
@@ -23,10 +23,29 @@ jobs:
2323
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e
2424
with:
2525
node-version: 18.x
26+
- uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b
27+
name: Setup Java
28+
with:
29+
distribution: temurin
30+
java-version: 11.x
31+
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55
32+
name: Setup Python
33+
with:
34+
python-version: 3.x
35+
- uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9
36+
name: Setup .NET
37+
with:
38+
dotnet-version: 9.0.x
39+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b
40+
name: Setup Go
41+
with:
42+
go-version: ^1.16.0
2643
- name: Install dependencies
2744
run: yarn install --check-files --frozen-lockfile
2845
- name: release
29-
run: npx projen release
46+
run: |
47+
unset CI # enable full package-all https://github.com/mongodb/awscdk-resources-mongodbatlas/blob/main/.projen/tasks.json#L157-L170
48+
npx projen release
3049
- name: Backup artifact permissions
3150
run: cd dist && getfacl -R . > permissions-backup.acl
3251
continue-on-error: true
@@ -55,16 +74,6 @@ jobs:
5574
- name: Restore build artifact permissions
5675
run: cd dist && setfacl --restore=permissions-backup.acl
5776
continue-on-error: true
58-
- name: Checkout
59-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
60-
with:
61-
path: .repo
62-
- name: Install Dependencies
63-
run: cd .repo && yarn install --check-files --frozen-lockfile
64-
- name: Create js artifact
65-
run: cd .repo && npx projen compile && npx projen package:js
66-
- name: Collect js Artifact
67-
run: mv .repo/dist/js dist/js
6877
- name: Release
6978
env:
7079
NPM_DIST_TAG: latest
@@ -105,16 +114,6 @@ jobs:
105114
- name: Restore build artifact permissions
106115
run: cd dist && setfacl --restore=permissions-backup.acl
107116
continue-on-error: true
108-
- name: Checkout
109-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
110-
with:
111-
path: .repo
112-
- name: Install Dependencies
113-
run: cd .repo && yarn install --check-files --frozen-lockfile
114-
- name: Create java artifact
115-
run: cd .repo && npx projen compile && npx projen package:java
116-
- name: Collect java Artifact
117-
run: mv .repo/dist/java dist/java
118117
- name: Release
119118
env:
120119
MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
@@ -156,16 +155,6 @@ jobs:
156155
- name: Restore build artifact permissions
157156
run: cd dist && setfacl --restore=permissions-backup.acl
158157
continue-on-error: true
159-
- name: Checkout
160-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
161-
with:
162-
path: .repo
163-
- name: Install Dependencies
164-
run: cd .repo && yarn install --check-files --frozen-lockfile
165-
- name: Create python artifact
166-
run: cd .repo && npx projen compile && npx projen package:python
167-
- name: Collect python Artifact
168-
run: mv .repo/dist/python dist/python
169158
- name: Release
170159
env:
171160
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
@@ -204,21 +193,6 @@ jobs:
204193
- name: Restore build artifact permissions
205194
run: cd dist && setfacl --restore=permissions-backup.acl
206195
continue-on-error: true
207-
- name: Checkout
208-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
209-
with:
210-
path: .repo
211-
fetch-depth: 0
212-
- name: Install Dependencies
213-
run: cd .repo && yarn install --check-files --frozen-lockfile
214-
- name: Create dotnet artifact
215-
run: |
216-
cd .repo
217-
npx projen bump
218-
npx projen compile
219-
npx projen package:dotnet
220-
- name: Collect dotnet Artifact
221-
run: mv .repo/dist/dotnet dist/dotnet
222196
- name: Extract Version
223197
id: extract-version
224198
run: echo "VERSION=$(cat dist/version.txt)" >> "${GITHUB_OUTPUT}"
@@ -270,16 +244,6 @@ jobs:
270244
- name: Restore build artifact permissions
271245
run: cd dist && setfacl --restore=permissions-backup.acl
272246
continue-on-error: true
273-
- name: Checkout
274-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
275-
with:
276-
path: .repo
277-
- name: Install Dependencies
278-
run: cd .repo && yarn install --check-files --frozen-lockfile
279-
- name: Create go artifact
280-
run: cd .repo && npx projen compile && npx projen package:go
281-
- name: Collect go Artifact
282-
run: mv .repo/dist/go dist/go
283247
- name: Release
284248
env:
285249
GITHUB_TOKEN: ${{ secrets.GO_GITHUB_TOKEN }}

RELEASING.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,26 @@
33

44
## Stable release
55

6-
Stable releases are managed by the [Release GitHub Action](https://github.com/mongodb/awscdk-resources-mongodbatlas/actions/workflows/release.yml). You can release a new CDK version by manually trigger the action.
6+
Stable releases are managed by the [Release GitHub Action](https://github.com/mongodb/awscdk-resources-mongodbatlas/actions/workflows/release.yml). You can release a new CDK version by manually triggering the action ([*MAKE SURE TO FOLLOW MANUAL STEPS BELOW*](#manual-steps)).
77

88
![Screenshot 2023-04-20 at 10 35 11](https://user-images.githubusercontent.com/5663078/233325734-0f469045-f91b-436c-8dd5-19d1e8f24c57.png)
99

10+
### Manual Steps
1011
After the action finishes successfully you have to manually release the Go package:
1112
- Go to the [Go repo](https://github.com/mongodb/awscdk-resources-mongodbatlas-go) and check that the latest commit happened now with the same release as in this repo, e.g. `chore(release): v3.0.0`.
1213
- Go to the [Go Repo release page](https://github.com/mongodb/awscdk-resources-mongodbatlas-go/releases).
1314
- Select the latest release that has to be the same as the one in this repo, e.g. `awscdkresourcemongodbatlas/v3.0.0`, name will be like `v3.0.0`, click "Generate release notes" and make sure "Set as latest release" is checked.
1415

16+
Also, to ensure no silent errors, look for the specific `vX.Y.Z` language releases:
17+
- [Javascript](https://www.npmjs.com/package/awscdk-resources-mongodbatlas?activeTab=versions)
18+
- [Java](https://central.sonatype.com/artifact/org.mongodb/awscdk-resources-mongodbatlas/versions)
19+
- [Python](https://pypi.org/project/awscdk-resources-mongodbatlas/#history)
20+
- [Golang (after the manual release above)](https://github.com/mongodb/awscdk-resources-mongodbatlas-go/releases)
21+
- [Nuget](https://www.nuget.org/packages/MongoDB.AWSCDKResourcesMongoDBAtlas#versions-body-tab)
22+
1523
## Versioning
1624
The release version is determinated based on the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) in that release.
1725

18-
1926
## Release troubleshooting
2027
If the Release Gitub Action fails, it can happen that the new version is published only to some repositories,
2128
but the failing ones are still in the current version.

0 commit comments

Comments
 (0)