From 9f05d8db707b2d117acf0a6f1f9796d9c1fa0b47 Mon Sep 17 00:00:00 2001 From: Jonne Kokkonen Date: Sun, 23 Feb 2025 20:19:21 +0200 Subject: [PATCH] add automatic rpm spec version bump --- .../{nix-package.yml => update-package-versions.yml} | 7 ++++--- package/rpm/m8c.spec | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) rename .github/workflows/{nix-package.yml => update-package-versions.yml} (85%) diff --git a/.github/workflows/nix-package.yml b/.github/workflows/update-package-versions.yml similarity index 85% rename from .github/workflows/nix-package.yml rename to .github/workflows/update-package-versions.yml index e0544bb..8d51711 100644 --- a/.github/workflows/nix-package.yml +++ b/.github/workflows/update-package-versions.yml @@ -1,4 +1,4 @@ -name: Update Version and Hash in flake.nix +name: Update Version and Hash in flake.nix/RPM spec on: push: @@ -42,15 +42,16 @@ jobs: echo "valid=false" >> $GITHUB_OUTPUT fi - - name: Update version in flake.nix + - name: Update version in flake.nix and RPM spec if: steps.valid-tag.outputs.valid run: | latest_annotated_tag="${{ steps.newest-tag.outputs.latest_annotated_tag }}" latest_annotated_tag_without_v="${latest_annotated_tag#v}" # Remove 'v' prefix sed -i "s/version = \".*\";/version = \"$latest_annotated_tag_without_v\";/" flake.nix + sed -i "s/Version:.*/Version: $latest_annotated_tag_without_v/" package/rpm/m8c.spec new_hash=$(nix-prefetch-url --unpack --type sha256 "https://github.com/laamaa/m8c/archive/v$latest_annotated_tag_without_v.tar.gz") # Use updated variable name sed -i "s/hash = \".*\";/hash = \"sha256:$new_hash\";/" flake.nix git config user.email "github-actions@github.com" git config user.name "GitHub Actions" - git commit -am "Update version and hash in flake.nix to $latest_annotated_tag_without_v" + git commit -am "Update version and hash in flake.nix, update RPM spec version to $latest_annotated_tag_without_v" git push origin HEAD:main diff --git a/package/rpm/m8c.spec b/package/rpm/m8c.spec index 293429c..6539feb 100644 --- a/package/rpm/m8c.spec +++ b/package/rpm/m8c.spec @@ -1,5 +1,5 @@ Name: m8c -Version: 1.7.8 +Version: 1.2.3 Release: 1%{?dist} Summary: m8c is a client for Dirtywave M8 music tracker's headless mode