fix: update hix hashes for all systems (#8732)

Co-authored-by: Github Action <action@github.com>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
This commit is contained in:
Ricardo Valero de la Rosa
2026-01-15 15:45:03 -06:00
committed by GitHub
parent b14622352e
commit 9862303eed
2 changed files with 43 additions and 36 deletions

View File

@@ -17,11 +17,11 @@ on:
- "packages/*/package.json" - "packages/*/package.json"
jobs: jobs:
update-linux: update-flake:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: blacksmith-4vcpu-ubuntu-2404 runs-on: ubuntu-latest
env: env:
SYSTEM: x86_64-linux TITLE: flake.lock
steps: steps:
- name: Checkout repository - name: Checkout repository
@@ -33,39 +33,32 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
- name: Setup Nix - name: Setup Nix
uses: DeterminateSystems/nix-installer-action@v20 uses: nixbuild/nix-quick-install-action@v34
- name: Configure git - name: Configure git
run: | run: |
git config --global user.email "action@github.com" git config --global user.email "action@github.com"
git config --global user.name "Github Action" git config --global user.name "Github Action"
- name: Update flake.lock - name: Update ${{ env.TITLE }}
run: | run: |
set -euo pipefail set -euo pipefail
echo "📦 Updating flake.lock..." echo "📦 Updating $TITLE..."
nix flake update nix flake update
echo "✅ flake.lock updated successfully" echo "✅ $TITLE updated successfully"
- name: Update node_modules hash for x86_64-linux - name: Commit ${{ env.TITLE }} changes
run: |
set -euo pipefail
echo "🔄 Updating node_modules hash for x86_64-linux..."
nix/scripts/update-hashes.sh
echo "✅ node_modules hash for x86_64-linux updated successfully"
- name: Commit Linux hash changes
env: env:
TARGET_BRANCH: ${{ github.head_ref || github.ref_name }} TARGET_BRANCH: ${{ github.head_ref || github.ref_name }}
run: | run: |
set -euo pipefail set -euo pipefail
echo "🔍 Checking for changes in tracked Nix files..." echo "🔍 Checking for changes in tracked files..."
summarize() { summarize() {
local status="$1" local status="$1"
{ {
echo "### Nix Hash Update (x86_64-linux)" echo "### Nix $TITLE"
echo "" echo ""
echo "- ref: ${GITHUB_REF_NAME}" echo "- ref: ${GITHUB_REF_NAME}"
echo "- status: ${status}" echo "- status: ${status}"
@@ -75,11 +68,10 @@ jobs:
fi fi
echo "" >> "$GITHUB_STEP_SUMMARY" echo "" >> "$GITHUB_STEP_SUMMARY"
} }
FILES=(flake.lock flake.nix)
FILES=(flake.lock flake.nix nix/node-modules.nix nix/hashes.json)
STATUS="$(git status --short -- "${FILES[@]}" || true)" STATUS="$(git status --short -- "${FILES[@]}" || true)"
if [ -z "$STATUS" ]; then if [ -z "$STATUS" ]; then
echo "✅ No changes detected. Hashes are already up to date." echo "✅ No changes detected."
summarize "no changes" summarize "no changes"
exit 0 exit 0
fi fi
@@ -89,7 +81,7 @@ jobs:
echo "🔗 Staging files..." echo "🔗 Staging files..."
git add "${FILES[@]}" git add "${FILES[@]}"
echo "💾 Committing changes..." echo "💾 Committing changes..."
git commit -m "Update Nix flake.lock and x86_64-linux hash" git commit -m "Update $TITLE"
echo "✅ Changes committed" echo "✅ Changes committed"
BRANCH="${TARGET_BRANCH:-${GITHUB_REF_NAME}}" BRANCH="${TARGET_BRANCH:-${GITHUB_REF_NAME}}"
@@ -101,12 +93,25 @@ jobs:
summarize "committed $(git rev-parse --short HEAD)" summarize "committed $(git rev-parse --short HEAD)"
update-macos: update-node-modules-hash:
needs: update-linux needs: update-flake
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: macos-latest strategy:
fail-fast: false
matrix:
include:
- system: x86_64-linux
host: ubuntu-latest
- system: aarch64-linux
host: ubuntu-22.04-arm
- system: x86_64-darwin
host: macos-15-intel
- system: aarch64-darwin
host: macos-latest
runs-on: ${{ matrix.host }}
env: env:
SYSTEM: aarch64-darwin SYSTEM: ${{ matrix.system }}
TITLE: node_modules hash (${{ matrix.system }})
steps: steps:
- name: Checkout repository - name: Checkout repository
@@ -118,7 +123,7 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
- name: Setup Nix - name: Setup Nix
uses: DeterminateSystems/nix-installer-action@v20 uses: nixbuild/nix-quick-install-action@v34
- name: Configure git - name: Configure git
run: | run: |
@@ -132,25 +137,25 @@ jobs:
BRANCH="${TARGET_BRANCH:-${GITHUB_REF_NAME}}" BRANCH="${TARGET_BRANCH:-${GITHUB_REF_NAME}}"
git pull origin "$BRANCH" git pull origin "$BRANCH"
- name: Update node_modules hash for aarch64-darwin - name: Update ${{ env.TITLE }}
run: | run: |
set -euo pipefail set -euo pipefail
echo "🔄 Updating node_modules hash for aarch64-darwin..." echo "🔄 Updating $TITLE..."
nix/scripts/update-hashes.sh nix/scripts/update-hashes.sh
echo "✅ node_modules hash for aarch64-darwin updated successfully" echo "✅ $TITLE updated successfully"
- name: Commit macOS hash changes - name: Commit ${{ env.TITLE }} changes
env: env:
TARGET_BRANCH: ${{ github.head_ref || github.ref_name }} TARGET_BRANCH: ${{ github.head_ref || github.ref_name }}
run: | run: |
set -euo pipefail set -euo pipefail
echo "🔍 Checking for changes in tracked Nix files..." echo "🔍 Checking for changes in tracked files..."
summarize() { summarize() {
local status="$1" local status="$1"
{ {
echo "### Nix Hash Update (aarch64-darwin)" echo "### Nix $TITLE"
echo "" echo ""
echo "- ref: ${GITHUB_REF_NAME}" echo "- ref: ${GITHUB_REF_NAME}"
echo "- status: ${status}" echo "- status: ${status}"
@@ -164,7 +169,7 @@ jobs:
FILES=(nix/hashes.json) FILES=(nix/hashes.json)
STATUS="$(git status --short -- "${FILES[@]}" || true)" STATUS="$(git status --short -- "${FILES[@]}" || true)"
if [ -z "$STATUS" ]; then if [ -z "$STATUS" ]; then
echo "✅ No changes detected. Hash is already up to date." echo "✅ No changes detected."
summarize "no changes" summarize "no changes"
exit 0 exit 0
fi fi
@@ -174,7 +179,7 @@ jobs:
echo "🔗 Staging files..." echo "🔗 Staging files..."
git add "${FILES[@]}" git add "${FILES[@]}"
echo "💾 Committing changes..." echo "💾 Committing changes..."
git commit -m "Update aarch64-darwin hash" git commit -m "Update $TITLE"
echo "✅ Changes committed" echo "✅ Changes committed"
BRANCH="${TARGET_BRANCH:-${GITHUB_REF_NAME}}" BRANCH="${TARGET_BRANCH:-${GITHUB_REF_NAME}}"

View File

@@ -1,6 +1,8 @@
{ {
"nodeModules": { "nodeModules": {
"x86_64-linux": "sha256-Fl1BdjNSg19LJVSgDMiBX8JuTaGlL2I5T+rqLfjSeO4=", "x86_64-linux": "sha256-4ndHIlS9t1ynRdFszJ1nvcu3YhunhuOc7jcuHI1FbnM=",
"aarch64-darwin": "sha256-7UajHu40n7JKqurU/+CGlitErsVFA2qDneUytI8+/zQ=" "aarch64-linux": "sha256-H9eUk/yVrQqVrAYONlb6As7mjkPXtOauBVfMBeVAmRo=",
"aarch64-darwin": "sha256-C0E9KAEj3GI83HwirIL2zlXYIe92T+7Iv6F51BB6slY=",
"x86_64-darwin": "sha256-wj5fZnyfu6Sf1HcqvsQM3M7dl5BKRAHmoqm1Ai1cL2M="
} }
} }