Skip to content

Commit 88232b6

Browse files
committed
fix(ci): use latest build artifact in release
1 parent b9e5fc7 commit 88232b6

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

.github/release-drafter.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name-template: 'v$NEXT_PATCH_VERSION'
2+
tag-template: 'v$NEXT_PATCH_VERSION'
3+
categories:
4+
- title: '🚀 Features'
5+
labels:
6+
- 'feature'
7+
- title: '🐛 Bug Fixes'
8+
labels:
9+
- 'bug'
10+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
11+
template: |
12+
## What's Changed
13+
$CHANGES

.github/workflows/release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,19 @@ jobs:
1313
- name: Checkout code
1414
uses: actions/checkout@v4
1515

16+
- name: Get latest successful build run-id
17+
id: get_run_id
18+
run: |
19+
latest_run_id=$(gh api repos/${{ github.repository }}/actions/workflows/build.yml/runs \
20+
-q '.workflow_runs | map(select(.conclusion == "success")) | first | .id')
21+
echo "run_id=$latest_run_id" >> $GITHUB_ENV
22+
1623
- name: Download build artifacts
1724
uses: actions/download-artifact@v4
1825
with:
1926
name: build-artifacts
27+
path: dist
28+
run-id: ${{ env.run_id }}
2029

2130
- name: Create Release
2231
id: create_release
@@ -26,7 +35,7 @@ jobs:
2635
with:
2736
tag_name: ${{ github.ref }}
2837
release_name: Release ${{ github.ref }}
29-
draft: false
38+
draft: true
3039
prerelease: false
3140

3241
- name: Upload Release Asset

0 commit comments

Comments
 (0)