From fb362ad0dbd56dbdea79e5b142b86048bed21126 Mon Sep 17 00:00:00 2001 From: Aliou Diallo Date: Thu, 12 Mar 2026 22:33:53 +0100 Subject: [PATCH] fix(ci): add git user configuration before committing flake.nix update --- .github/workflows/version.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index d49e343..7fbffc2 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: inputs: force_release: - description: 'Force create release for current version' + description: "Force create release for current version" type: boolean default: false @@ -63,10 +63,11 @@ jobs: title: "release: v${{ steps.version.outputs.version }}" body: | This PR was auto-generated to release v${{ steps.version.outputs.version }}. - + Merging will create a git tag and GitHub release. branch: release/v${{ steps.version.outputs.version }} delete-branch: true + release: name: Release runs-on: ubuntu-latest @@ -106,14 +107,14 @@ jobs: run: | VERSION=$(jq -r '.version' package.json) TAG="v${VERSION}" - + # Configure git user git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - + # Build binaries bun run build - + # Compute hashes and update flake.nix DARWIN_ARM_HASH=$(nix hash file --sri dist/linear-darwin-arm64) LINUX_ARM_HASH=$(nix hash file --sri dist/linear-linux-arm64) @@ -121,16 +122,16 @@ jobs: echo "Darwin ARM64 hash: $DARWIN_ARM_HASH" echo "Linux ARM64 hash: $LINUX_ARM_HASH" echo "Linux x64 hash: $LINUX_X64_HASH" - + sed -i "s|hash = \"sha256-.*\"; # darwin|hash = \"${DARWIN_ARM_HASH}\"; # darwin|" flake.nix sed -i "s|hash = \"sha256-.*\"; # linux-arm64|hash = \"${LINUX_ARM_HASH}\"; # linux-arm64|" flake.nix sed -i "s|hash = \"sha256-.*\"; # linux-x64|hash = \"${LINUX_X64_HASH}\"; # linux-x64|" flake.nix - + # Commit and push flake.nix git add flake.nix git commit -m "chore: update binary hashes for ${TAG}" git push origin main - + # Check if we should create a release if git ls-remote --tags origin | grep -q "refs/tags/${TAG}$"; then if [ "${{ inputs.force_release }}" != "true" ]; then @@ -138,7 +139,7 @@ jobs: exit 0 fi fi - + # Create the release git tag -a "${TAG}" -m "Release ${TAG}" git push origin "${TAG}" @@ -149,7 +150,7 @@ jobs: dist/linear-linux-arm64 \ dist/linear-linux-x64 \ SKILL.md - + # Update Homebrew tap DARWIN_SHA256=$(shasum -a 256 dist/linear-darwin-arm64 | awk '{print $1}') gh api repos/aliou/homebrew-toolbox/dispatches \ @@ -161,4 +162,5 @@ jobs: -f "client_payload[sha256]=${DARWIN_SHA256}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }} \ No newline at end of file + TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }} + -- 2.51.2