Repository navigation
fix: release pipeline trigger and version-agnostic package URLs #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,9 +1,8 @@ | ||||||||
| name: Release | ||||||||
|
|
||||||||
| on: | ||||||||
| push: | ||||||||
| tags: | ||||||||
| - 'v*' | ||||||||
| release: | ||||||||
| types: [published] | ||||||||
| workflow_dispatch: | ||||||||
| inputs: | ||||||||
| tag: | ||||||||
|
|
@@ -150,25 +149,41 @@ jobs: | |||||||
| run: | | ||||||||
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | ||||||||
| echo "version=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT | ||||||||
| elif [[ "${{ github.ref }}" == refs/tags/* ]]; then | ||||||||
| echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | ||||||||
| else | ||||||||
| # Extract version from Cargo.toml for push to master | ||||||||
| VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/') | ||||||||
| echo "version=v${VERSION}" >> $GITHUB_OUTPUT | ||||||||
| elif [ "${{ github.event_name }}" = "release" ]; then | ||||||||
| echo "version=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT | ||||||||
| fi | ||||||||
|
|
||||||||
| - name: Flatten artifacts | ||||||||
| run: | | ||||||||
| mkdir -p release | ||||||||
| find artifacts -type f \( -name "*.tar.gz" -o -name "*.zip" -o -name "*.deb" -o -name "*.rpm" \) -exec cp {} release/ \; | ||||||||
|
|
||||||||
| - name: Create version-agnostic package names | ||||||||
| run: | | ||||||||
| cd release | ||||||||
| for f in *.deb; do | ||||||||
| [ -f "$f" ] && cp "$f" "rtk_amd64.deb" | ||||||||
| done | ||||||||
| for f in *.rpm; do | ||||||||
| [ -f "$f" ] && cp "$f" "rtk.x86_64.rpm" | ||||||||
| done | ||||||||
|
|
||||||||
| - name: Create checksums | ||||||||
| run: | | ||||||||
| cd release | ||||||||
| sha256sum * > checksums.txt | ||||||||
|
||||||||
| sha256sum * > checksums.txt | |
| # Generate checksums only for archives and version-agnostic package names | |
| sha256sum *.tar.gz *.zip rtk_amd64.deb rtk.x86_64.rpm 2>/dev/null > checksums.txt || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version-agnostic package naming logic assumes only one DEB and one RPM file will be present. The loop will overwrite
rtk_amd64.debif multiple.debfiles exist (though currently only one is created). Consider adding a check to ensure only one file of each type exists, or use a more specific pattern to select the correct file. For example, you could break after the first match or use a more specific glob pattern.