Skip to content

Commit ea9dd41

Browse files
authored
ci: add preview tarball workflow (#1349)
* ci: add preview tarball workflow for prerelease builds * ci: use default GITHUB_TOKEN instead of app token * ci: use node 20.x for consistency * ci: rename preview to prerelease
1 parent 6043caa commit ea9dd41

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Prerelease Tarball
2+
3+
on:
4+
push:
5+
branches: [main]
6+
# Manually trigger to pull in the latest CDK constructs changes
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
concurrency:
13+
group: prerelease-tarball
14+
cancel-in-progress: true
15+
16+
jobs:
17+
prerelease-tarball:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v6
21+
- uses: actions/setup-node@v6
22+
with:
23+
node-version: '20.x'
24+
cache: 'npm'
25+
- uses: astral-sh/setup-uv@v7
26+
- run: npm run bundle
27+
- name: Get tarball info
28+
id: tarball
29+
run: |
30+
TARBALL_NAME=$(ls *.tgz | head -1 | xargs basename)
31+
echo "name=$TARBALL_NAME" >> $GITHUB_OUTPUT
32+
- name: Create or update prerelease
33+
env:
34+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
TARBALL_NAME: ${{ steps.tarball.outputs.name }}
36+
run: |
37+
TAG="prerelease"
38+
39+
# Delete existing release if it exists (to update the tarball)
40+
gh release delete "$TAG" --yes --cleanup-tag 2>/dev/null || true
41+
42+
# Create a new pre-release with the tarball
43+
gh release create "$TAG" \
44+
"${TARBALL_NAME}" \
45+
--title "Prerelease" \
46+
--notes "Auto-generated tarball from the latest commit on main." \
47+
--prerelease \
48+
--target "${{ github.sha }}"

0 commit comments

Comments
 (0)