Skip to content

Commit b6f31e4

Browse files
committed
create single draft
1 parent d8f6b93 commit b6f31e4

1 file changed

Lines changed: 27 additions & 14 deletions

File tree

.github/workflows/release.yml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,6 @@ jobs:
3737
- name: Install Rust
3838
uses: dtolnay/rust-toolchain@stable
3939

40-
- name: Read version from Cargo.toml
41-
id: version
42-
shell: bash
43-
run: |
44-
version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n 1)
45-
if [ -z "$version" ]; then
46-
echo "Could not read version from Cargo.toml" >&2
47-
exit 1
48-
fi
49-
echo "version=$version" >> "$GITHUB_OUTPUT"
50-
echo "tag=v$version" >> "$GITHUB_OUTPUT"
51-
5240
- name: Build release binary
5341
run: cargo build --release
5442

@@ -79,10 +67,35 @@ jobs:
7967
name: ${{ matrix.name }}
8068
path: dist/${{ matrix.asset_name }}
8169

82-
- name: Upload release asset to draft release
70+
release:
71+
name: Create draft release
72+
runs-on: ubuntu-latest
73+
needs: build
74+
steps:
75+
- name: Checkout
76+
uses: actions/checkout@v4
77+
78+
- name: Read version from Cargo.toml
79+
id: version
80+
shell: bash
81+
run: |
82+
version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n 1)
83+
if [ -z "$version" ]; then
84+
echo "Could not read version from Cargo.toml" >&2
85+
exit 1
86+
fi
87+
echo "tag=v$version" >> "$GITHUB_OUTPUT"
88+
89+
- name: Download all build artifacts
90+
uses: actions/download-artifact@v4
91+
with:
92+
path: dist
93+
merge-multiple: true
94+
95+
- name: Upload assets to draft release
8396
uses: softprops/action-gh-release@v2
8497
with:
8598
tag_name: ${{ steps.version.outputs.tag }}
8699
target_commitish: ${{ github.sha }}
87100
draft: true
88-
files: dist/${{ matrix.asset_name }}
101+
files: dist/*

0 commit comments

Comments
 (0)