From c78b811b49895b713fbfcbe74f8c446f6ef40ca4 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Fri, 24 Jun 2022 19:44:53 +0300 Subject: Nix & Meson: fix update workflow --- .github/workflows/nix-meson-ver-update.yaml | 26 ++++++++++++++++++++++++++ .github/workflows/version-update.sh | 26 -------------------------- 2 files changed, 26 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/nix-meson-ver-update.yaml delete mode 100644 .github/workflows/version-update.sh (limited to '.github') diff --git a/.github/workflows/nix-meson-ver-update.yaml b/.github/workflows/nix-meson-ver-update.yaml new file mode 100644 index 00000000..1bf95af9 --- /dev/null +++ b/.github/workflows/nix-meson-ver-update.yaml @@ -0,0 +1,26 @@ +name: "Nix & Meson: update version" + +on: [push, workflow_dispatch] + +jobs: + update: + runs-on: ubuntu-latest + steps: + - name: Clone repository + uses: actions/checkout@v3 + - name: Update flake and meson version + run: | + REGEX="([0-9]+(\.[0-9a-zA-Z]+)+)" + + CRT_REV=$(git show-ref --tags --head --abbrev | head -n 1 | head -c 7) + TAG_REV=$(git show-ref --tags --abbrev | tail -n 1 | head -c 7) + CRT_VER=$(sed -nEe "/$REGEX/{p;q;}" meson.build | awk -F\' '{print $2}') + VERSION=$(git show-ref --tags --abbrev | tail -n 1 | tail -c +20) + + if [[ $TAG_REV = $CRT_REV ]] || [[ $CRT_VER != $VERSION ]]; then + sed -Ei "s/$REGEX/$VERSION/g" meson.build + sed -Ei "s/$REGEX/$VERSION/g" flake.nix + fi + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "[gha] bump flake and meson version" diff --git a/.github/workflows/version-update.sh b/.github/workflows/version-update.sh deleted file mode 100644 index 1bf95af9..00000000 --- a/.github/workflows/version-update.sh +++ /dev/null @@ -1,26 +0,0 @@ -name: "Nix & Meson: update version" - -on: [push, workflow_dispatch] - -jobs: - update: - runs-on: ubuntu-latest - steps: - - name: Clone repository - uses: actions/checkout@v3 - - name: Update flake and meson version - run: | - REGEX="([0-9]+(\.[0-9a-zA-Z]+)+)" - - CRT_REV=$(git show-ref --tags --head --abbrev | head -n 1 | head -c 7) - TAG_REV=$(git show-ref --tags --abbrev | tail -n 1 | head -c 7) - CRT_VER=$(sed -nEe "/$REGEX/{p;q;}" meson.build | awk -F\' '{print $2}') - VERSION=$(git show-ref --tags --abbrev | tail -n 1 | tail -c +20) - - if [[ $TAG_REV = $CRT_REV ]] || [[ $CRT_VER != $VERSION ]]; then - sed -Ei "s/$REGEX/$VERSION/g" meson.build - sed -Ei "s/$REGEX/$VERSION/g" flake.nix - fi - - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: "[gha] bump flake and meson version" -- cgit v1.2.3