diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index cdbc21bb..ef091869 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -12,11 +12,32 @@ jobs: contents: write steps: - uses: actions/checkout@v6 + with: + ref: ${{ github.head_ref }} + fetch-depth: 0 - name: Install Nix uses: cachix/install-nix-action@v31 - - name: Build package - id: build - continue-on-error: true - run: nix build -f default.nix + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + + - name: Install fixsha + run: cargo install fixsha + + - name: Run fixsha + run: fixsha + + - name: Commit hash fixes + if: github.event_name == 'pull_request' + run: | + if [[ -n $(git status -s package.nix) ]]; then + git config user.name "Akrm Al-Hakimi" + git config user.email "alhakimiakrmj@gmail.com" + git add package.nix + git commit -m "chore(nix): fix cargoHash" + git push + fi diff --git a/package.nix b/package.nix index a4d40a33..314f967f 100644 --- a/package.nix +++ b/package.nix @@ -19,7 +19,7 @@ rustPlatform.buildRustPackage { src = ./.; - cargoHash = "sha256-MhxJFul0+N7K2s/5HaLy2JkEJxCAp4I8B62yw5CIZkY="; + cargoHash = "sha256-B66aZgJyhk3cn9yz125Nf2on+6PC/kvee4HiIVThhfg="; nativeBuildInputs = [ pkg-config @@ -47,4 +47,4 @@ rustPlatform.buildRustPackage { mainProgram = "nmrs"; platforms = platforms.linux ++ platforms.darwin; }; -} +} \ No newline at end of file