Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions .github/workflows/release.yml
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:
Expand Down Expand Up @@ -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"
Comment on lines +165 to +168

Copilot AI Jan 30, 2026

Copy link

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.deb if multiple .deb files 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.

Suggested change
[ -f "$f" ] && cp "$f" "rtk_amd64.deb"
done
for f in *.rpm; do
[ -f "$f" ] && cp "$f" "rtk.x86_64.rpm"
if [ -f "$f" ]; then
cp "$f" "rtk_amd64.deb"
break
fi
done
for f in *.rpm; do
if [ -f "$f" ]; then
cp "$f" "rtk.x86_64.rpm"
break
fi

Copilot uses AI. Check for mistakes.
done

- name: Create checksums
run: |
cd release
sha256sum * > checksums.txt

Copilot AI Jan 30, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checksums.txt file will include checksums for both the versioned packages (e.g., rtk_0.5.0-1_amd64.deb) and the version-agnostic copies (e.g., rtk_amd64.deb). Since these are copies with identical content, users might find duplicate checksums confusing. Consider generating checksums only for the version-agnostic files, or documenting this in the release notes.

Suggested change
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

Copilot uses AI. Check for mistakes.

- name: Upload Release Assets
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.version }}
files: release/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
if: github.event_name == 'workflow_dispatch'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.version }}
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ cargo install rtk

### Debian/Ubuntu
```bash
curl -LO https://github.com/pszymkowiak/rtk/releases/latest/download/rtk_0.3.1-1_amd64.deb
sudo dpkg -i rtk_0.3.1-1_amd64.deb
curl -LO https://github.com/pszymkowiak/rtk/releases/latest/download/rtk_amd64.deb
sudo dpkg -i rtk_amd64.deb
```

### Fedora/RHEL
```bash
curl -LO https://github.com/pszymkowiak/rtk/releases/latest/download/rtk-0.3.1-1.x86_64.rpm
sudo rpm -i rtk-0.3.1-1.x86_64.rpm
curl -LO https://github.com/pszymkowiak/rtk/releases/latest/download/rtk.x86_64.rpm
sudo rpm -i rtk.x86_64.rpm
```

### Manual Download
Expand Down
Loading