From 3e1eb9d5e6289d971782befd94324649c4ac17d3 Mon Sep 17 00:00:00 2001 From: Kevin Stewart Date: Tue, 13 May 2025 14:33:31 -0700 Subject: [PATCH] Create versioned release tarball The release workflow now produces a tarball named `rayhunter-v.tar`, where the version is dynamically extracted from `rayhunter/bin/Cargo.toml`. Additionally, the archive contains a top-level directory named `rayhunter-v/`, making each release artifact clearly identifiable and self-contained by version. This change improves clarity for downstream consumers and simplifies managing multiple versions. --- .github/workflows/build-release.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index e9388f3..50e8e7c 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -4,7 +4,7 @@ on: push: branches: [main, "release-*"] pull_request: - branches: [ "main" ] + branches: ["main"] env: CARGO_TERM_COLOR: always @@ -99,14 +99,21 @@ jobs: - uses: actions/download-artifact@v4 - name: Fix executable permissions on binaries run: chmod +x serial-*/serial rayhunter-check-*/rayhunter-check rayhunter-daemon-*/rayhunter-daemon - - name: Setup release directory - run: mv rayhunter-daemon-* rootshell/rootshell serial-* dist + - name: Get Rayhunter version + id: get_version + run: echo "VERSION=$(grep '^version' bin/Cargo.toml | head -n 1 | cut -d'"' -f2)" >> $GITHUB_ENV + - name: Setup versioned release directory + run: | + VERSIONED_DIR="rayhunter-v${{ env.VERSION }}" + mkdir "$VERSIONED_DIR" + mv dist/* "$VERSIONED_DIR"/ - name: Archive release directory - run: tar -cvf release.tar -C dist . - # TODO: have this create a release directly + run: | + VERSIONED_DIR="rayhunter-v${{ env.VERSION }}" + tar -cvf "$VERSIONED_DIR.tar" "$VERSIONED_DIR" - name: Upload release uses: actions/upload-artifact@v4 with: - name: release.tar - path: release.tar + name: rayhunter-v${{ env.VERSION }}.tar + path: rayhunter-v${{ env.VERSION }}.tar if-no-files-found: error