Skip to content

Commit f4782c3

Browse files
committed
fix(ci): Simplify release process.
Run all publishing tasks in the same workflow.
1 parent a317141 commit f4782c3

File tree

1 file changed

+11
-149
lines changed

1 file changed

+11
-149
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ jobs:
5757
python-version: 3.12.3
5858
- name: Install NPM dependencies
5959
run: npx projen install:ci
60-
- name: release
60+
- name: Build
61+
run: npx projen build --verbose
62+
- name: Release
6163
run: npx projen release
6264
- name: Backup artifact permissions
6365
run: cd dist && getfacl -R . > permissions-backup.acl
@@ -66,180 +68,40 @@ jobs:
6668
uses: actions/upload-artifact@v3
6769
with:
6870
name: build-artifact
69-
path: dist
71+
path: |
72+
dist
73+
!**/target
74+
include-hidden-files: true
7075
- name: Release GitHub
7176
env:
7277
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7378
GITHUB_REPOSITORY: ${{ github.repository }}
7479
GITHUB_REF: ${{ github.ref }}
7580
run: errout=$(mktemp); gh release create $(cat dist/releasetag.txt) -R $GITHUB_REPOSITORY -F dist/changelog.md -t $(cat dist/releasetag.txt) --target $GITHUB_REF 2> $errout && true; exitcode=$?; if [ $exitcode -ne 0 ] && ! grep -q "Release.tag_name already exists" $errout; then cat $errout; exit $exitcode; fi
76-
release_npm:
77-
name: Publish to npm
78-
needs: release_github
79-
runs-on: ubuntu-latest
80-
permissions:
81-
contents: read
82-
steps:
83-
- uses: actions/setup-node@v4
84-
with:
85-
node-version: 20.x
86-
- name: Download build artifacts
87-
uses: actions/download-artifact@v3
88-
with:
89-
name: build-artifact
90-
path: dist
91-
- name: Restore build artifact permissions
92-
run: cd dist && setfacl --restore=permissions-backup.acl
93-
continue-on-error: true
94-
- name: Prepare Repository
95-
run: mv dist .repo
96-
- name: Install Dependencies
97-
run: cd .repo && npx projen install:ci
98-
- name: Create JS artifact
99-
run: cd .repo && npx projen package:js
100-
- name: Collect js Artifact
101-
run: mv .repo/dist dist
10281
- name: Release JS Artifact
10382
env:
10483
NPM_DIST_TAG: latest
10584
NPM_REGISTRY: registry.npmjs.org
10685
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
10786
run: npx -p publib@latest publib-npm
108-
release_maven:
109-
name: Publish to Maven Central
110-
needs: release_github
111-
runs-on: ubuntu-latest
112-
permissions:
113-
contents: read
114-
steps:
115-
- uses: actions/setup-java@v4
116-
with:
117-
distribution: temurin
118-
java-version: '17.x'
119-
- uses: actions/setup-node@v4
120-
with:
121-
node-version: 20.x
122-
- name: Download build artifacts
123-
uses: actions/download-artifact@v3
124-
with:
125-
name: build-artifact
126-
path: dist
127-
- name: Restore build artifact permissions
128-
run: cd dist && setfacl --restore=permissions-backup.acl
129-
continue-on-error: true
130-
- name: Prepare Repository
131-
run: mv dist .repo
132-
- name: Install Dependencies
133-
run: cd .repo && npx projen install:ci
134-
- name: Create java artifact
135-
run: cd .repo && npx projen package:java
136-
- name: Collect java Artifact
137-
run: mv .repo/dist dist
138-
- name: Release
87+
- name: Release Java Artifact
13988
env:
14089
MAVEN_SERVER_ID: 'github'
14190
MAVEN_REPOSITORY_URL: 'https://maven.pkg.github.com/cargo-lambda/cargo-lambda-cdk'
14291
MAVEN_ENDPOINT: 'https://maven.pkg.github.com'
14392
MAVEN_USERNAME: ${{ github.actor }}
14493
MAVEN_PASSWORD: ${{ secrets.CDK_PACKAGES_REGISTRY_GITHUB_TOKEN }}
14594
run: npx -p publib@latest publib-maven
146-
release_pypi:
147-
name: Publish to PyPI
148-
needs: release_github
149-
runs-on: ubuntu-latest
150-
permissions:
151-
contents: read
152-
steps:
153-
- uses: actions/setup-node@v4
154-
with:
155-
node-version: 20.x
156-
- uses: actions/setup-python@v5
157-
with:
158-
python-version: 3.12.3
159-
- name: Download build artifacts
160-
uses: actions/download-artifact@v3
161-
with:
162-
name: build-artifact
163-
path: dist
164-
- name: Restore build artifact permissions
165-
run: cd dist && setfacl --restore=permissions-backup.acl
166-
continue-on-error: true
167-
- name: Prepare Repository
168-
run: mv dist .repo
169-
- name: Install Dependencies
170-
run: cd .repo && npx projen install:ci
171-
- name: Create python artifact
172-
run: cd .repo && npx projen package:python
173-
- name: Collect python Artifact
174-
run: mv .repo/dist dist
175-
- name: Release
95+
- name: Release Python Artifact
17696
env:
17797
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
17898
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
17999
run: npx -p publib@latest publib-pypi
180-
release_nuget:
181-
name: Publish to NuGet Gallery
182-
needs: release_github
183-
runs-on: ubuntu-latest
184-
permissions:
185-
contents: read
186-
steps:
187-
- uses: actions/setup-node@v4
188-
with:
189-
node-version: 20.x
190-
- uses: actions/setup-dotnet@v4
191-
with:
192-
dotnet-version: 3.x
193-
- name: Download build artifacts
194-
uses: actions/download-artifact@v3
195-
with:
196-
name: build-artifact
197-
path: dist
198-
- name: Restore build artifact permissions
199-
run: cd dist && setfacl --restore=permissions-backup.acl
200-
continue-on-error: true
201-
- name: Prepare Repository
202-
run: mv dist .repo
203-
- name: Install Dependencies
204-
run: cd .repo && npx projen install:ci
205-
- name: Create dotnet artifact
206-
run: cd .repo && npx projen package:dotnet
207-
- name: Collect dotnet Artifact
208-
run: mv .repo/dist dist
209-
- name: Release
100+
- name: Release Dotnet Artifact
210101
env:
211102
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
212103
run: npx -p publib@latest publib-nuget
213-
release_golang:
214-
name: Publish to GitHub Go Module Repository
215-
needs: release_github
216-
runs-on: ubuntu-latest
217-
permissions:
218-
contents: read
219-
steps:
220-
- uses: actions/setup-node@v4
221-
with:
222-
node-version: 20.x
223-
- uses: actions/setup-go@v4
224-
with:
225-
go-version: ^1.16.0
226-
- name: Download build artifacts
227-
uses: actions/download-artifact@v3
228-
with:
229-
name: build-artifact
230-
path: dist
231-
- name: Restore build artifact permissions
232-
run: cd dist && setfacl --restore=permissions-backup.acl
233-
continue-on-error: true
234-
- name: Prepare Repository
235-
run: mv dist .repo
236-
- name: Install Dependencies
237-
run: cd .repo && npx projen install:ci
238-
- name: Create go artifact
239-
run: cd .repo && npx projen package:go
240-
- name: Collect go Artifact
241-
run: mv .repo/dist dist
242-
- name: Release
104+
- name: Release Go Artifact
243105
env:
244106
GIT_USER_NAME: github-actions
245107
GIT_USER_EMAIL: [email protected]

0 commit comments

Comments
 (0)