Skip to content
Open
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
6 changes: 3 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CD
on:
workflow_dispatch:
push:
branches: [develop, master]
branches: [main, develop, master]

concurrency:
group: cd-${{ github.ref }}
Expand All @@ -21,7 +21,7 @@ jobs:
pre-release:
if: >-
github.ref == 'refs/heads/develop'
|| (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master')
|| (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main')
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
# ═══════════════════════════════════════════════

release-please:
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && github.event_name == 'push'
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,50 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Verify release assets
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.version.outputs.version }}
run: |
set -e
required=(
rtk-x86_64-apple-darwin.tar.gz
rtk-aarch64-apple-darwin.tar.gz
rtk-x86_64-unknown-linux-musl.tar.gz
rtk-aarch64-unknown-linux-gnu.tar.gz
rtk-x86_64-pc-windows-msvc.zip
checksums.txt
)
assets=$(gh release view "$TAG" --repo "${{ github.repository }}" --json assets --jq '.assets[].name')
echo "Uploaded assets:"
echo "$assets"
missing=0
for name in "${required[@]}"; do
if ! echo "$assets" | grep -qx "$name"; then
echo "::error::Missing required asset: $name"
missing=1
fi
done
if [ "$missing" -ne 0 ]; then
echo "::error::Release $TAG is missing required assets — install.sh would 404"
exit 1
fi

- name: Smoke test release download
env:
TAG: ${{ steps.version.outputs.version }}
run: |
set -e
# Verify the freshly uploaded Linux binary is actually reachable and runs.
# We pin the tag (not /releases/latest) because prereleases and not-yet-promoted
# tags are invisible to that endpoint.
url="https://github.com/${{ github.repository }}/releases/download/${TAG}/rtk-x86_64-unknown-linux-musl.tar.gz"
echo "Downloading: $url"
tmp=$(mktemp -d)
curl -fsSL "$url" -o "$tmp/rtk.tar.gz"
tar -xzf "$tmp/rtk.tar.gz" -C "$tmp"
"$tmp/rtk" --version

notify-discord:
name: Notify Discord
needs: [release]
Expand Down