From 72d3d24e0443244827c4d72f4969cf6980a25bb5 Mon Sep 17 00:00:00 2001 From: Roger Duthie <343584+rjaduthie@users.noreply.github.com> Date: Thu, 19 Mar 2026 17:25:27 +0000 Subject: [PATCH 1/4] chore(DAAC-480): Add configuration to create RPM --- .github/workflows/build.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb5a905..47f4b58 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,35 @@ jobs: - name: Build for Linux run: cargo build --release --target x86_64-unknown-linux-gnu --verbose + - name: Install Ruby and FPM + run: | + sudo apt-get update + sudo apt-get install -y ruby ruby-dev rubygems build-essential rpm + sudo gem install --no-document fpm + + - name: Create RPM package + run: | + mkdir -p package/usr/local/bin + cp target/x86_64-unknown-linux-gnu/release/pathFinder package/usr/local/bin/ + chmod +x package/usr/local/bin/pathFinder + + fpm -s dir -t rpm \ + -n pathfinder \ + -v 1.0.0 \ + --iteration 1 \ + --description "SKA path finder tool for locating and mounting data from SKA storage systems" \ + --url "https://github.com/ska-telescope/pathfinder" \ + --license "BSD-3-Clause" \ + -C package \ + usr/local/bin/pathFinder + + - name: Upload RPM package + if: ${{ !env.ACT }} + uses: actions/upload-artifact@v4 + with: + name: pathfinder-rpm + path: "*.rpm" + - name: Upload Linux binary if: ${{ !env.ACT }} uses: actions/upload-artifact@v4 From 216da44c2e7acc9efc30c793a62cf7f14b13ce5f Mon Sep 17 00:00:00 2001 From: Roger Duthie <343584+rjaduthie@users.noreply.github.com> Date: Thu, 19 Mar 2026 18:19:14 +0000 Subject: [PATCH 2/4] chore(SOG-480): Configure publishing of RPM for DNF --- .github/workflows/build.yml | 43 ++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47f4b58..626d652 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,12 +3,18 @@ name: Build on: push: branches: [main] + tags: + - "v*" pull_request: branches: [main] + release: + types: [created] jobs: build-linux: runs-on: ubuntu-22.04 + permissions: + contents: write steps: - uses: actions/checkout@v4 @@ -17,6 +23,30 @@ jobs: with: cache: ${{ !env.ACT }} + - name: Extract version from Cargo.toml + id: cargo_version + run: | + CARGO_VERSION=$(grep -m1 "^version" Cargo.toml | cut -d '"' -f2) + echo "version=$CARGO_VERSION" >> $GITHUB_OUTPUT + echo "Cargo.toml version: $CARGO_VERSION" + + - name: Validate tag matches Cargo.toml version + if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'release' + run: | + TAG_VERSION=${GITHUB_REF#refs/tags/v} + CARGO_VERSION=${{ steps.cargo_version.outputs.version }} + + echo "Tag version: v$TAG_VERSION" + echo "Cargo.toml version: $CARGO_VERSION" + + if [[ "$TAG_VERSION" != "$CARGO_VERSION" ]]; then + echo "❌ Error: Tag version (v$TAG_VERSION) does not match Cargo.toml version ($CARGO_VERSION)" + echo "Please ensure the git tag matches the version in Cargo.toml" + exit 1 + fi + + echo "✓ Version check passed: Tag and Cargo.toml versions match" + - name: Build for Linux run: cargo build --release --target x86_64-unknown-linux-gnu --verbose @@ -34,7 +64,7 @@ jobs: fpm -s dir -t rpm \ -n pathfinder \ - -v 1.0.0 \ + -v ${{ steps.cargo_version.outputs.version }} \ --iteration 1 \ --description "SKA path finder tool for locating and mounting data from SKA storage systems" \ --url "https://github.com/ska-telescope/pathfinder" \ @@ -55,3 +85,14 @@ jobs: with: name: pathfinder-linux-x64 path: target/x86_64-unknown-linux-gnu/release/pathFinder + + - name: Upload artifacts to release + if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'release' + uses: softprops/action-gh-release@v1 + with: + files: | + *.rpm + target/x86_64-unknown-linux-gnu/release/pathFinder + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 110c80a7b30e5a6a243d8166fae4f7872131307a Mon Sep 17 00:00:00 2001 From: Roger Duthie <343584+rjaduthie@users.noreply.github.com> Date: Fri, 20 Mar 2026 12:16:01 +0000 Subject: [PATCH 3/4] fix(SOG-480): Install pathFinder in /usr/bin --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 626d652..fc6dd7a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,9 +58,9 @@ jobs: - name: Create RPM package run: | - mkdir -p package/usr/local/bin - cp target/x86_64-unknown-linux-gnu/release/pathFinder package/usr/local/bin/ - chmod +x package/usr/local/bin/pathFinder + mkdir -p package/usr/bin + cp target/x86_64-unknown-linux-gnu/release/pathFinder package/usr/bin/ + chmod +x package/usr/bin/pathFinder fpm -s dir -t rpm \ -n pathfinder \ @@ -70,7 +70,7 @@ jobs: --url "https://github.com/ska-telescope/pathfinder" \ --license "BSD-3-Clause" \ -C package \ - usr/local/bin/pathFinder + usr/bin/pathFinder - name: Upload RPM package if: ${{ !env.ACT }} From 520d0e88a4a83d41c179faa4f165599b7011a1ee Mon Sep 17 00:00:00 2001 From: Roger Duthie <343584+rjaduthie@users.noreply.github.com> Date: Wed, 1 Apr 2026 10:13:50 +0100 Subject: [PATCH 4/4] chore(SOG-480): Update CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d17abde..efdd3e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Test coverage and GitHub action to run them +- GitHub action to create and publish RPM on release ### Changed @@ -21,3 +22,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial Rust implementation +