Skip to content

Commit 4f57ad7

Browse files
authored
Merge pull request #1475 from dtolnay/releasearchive
Add GitHub workflow to upload release archives with stable hash
2 parents 9da48f5 + a3f2ad4 commit 4f57ad7

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

.bcr/source.template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"integrity": "**leave this alone**",
33
"strip_prefix": "{REPO}-{VERSION}",
4-
"url": "https://github.com/{OWNER}/{REPO}/archive/refs/tags/{VERSION}.zip"
4+
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{VERSION}/{REPO}-{VERSION}.tar.gz"
55
}

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [released]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
upload:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Upload Release Archive
17+
run: |
18+
export ASSET_NAME=${{github.event.repository.name}}-${{github.ref_name}}.tar.gz
19+
git ls-tree -r --name-only HEAD | xargs tar --transform "s#^#${{github.event.repository.name}}-${{github.event.release.tag_name}}/#" -czf $ASSET_NAME
20+
gh release upload ${{github.ref_name}} $ASSET_NAME

0 commit comments

Comments
 (0)