Use the upstream caching action, build ourselves, and re-run using our own built version
This commit is contained in:
parent
3623d6aee8
commit
81af9b36fb
79
.github/workflows/build.yaml
vendored
79
.github/workflows/build.yaml
vendored
|
@ -6,39 +6,74 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-artifacts-x86_64-macos:
|
build-artifacts-macOS:
|
||||||
runs-on: macos-12
|
runs-on: macos-12
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: DeterminateSystems/nix-installer-action@main
|
|
||||||
|
|
||||||
- name: "Build something"
|
|
||||||
run: "nix develop -c cargo build --release"
|
|
||||||
|
|
||||||
- name: Upload a Build Artifact
|
|
||||||
uses: actions/upload-artifact@v3.1.2
|
|
||||||
with:
|
|
||||||
# Artifact name
|
|
||||||
name: nix-actions-cache-x86_64-darwin
|
|
||||||
path: target/release/nix-actions-cache
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
build-artifacts-x86_64-linux:
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- uses: DeterminateSystems/nix-installer-action-cache@main
|
- uses: DeterminateSystems/nix-installer-action-cache@main
|
||||||
|
|
||||||
- name: "Build something"
|
- name: "Build something"
|
||||||
run: "nix develop -c cargo build --release"
|
run: "nix develop -c cargo build --release"
|
||||||
|
|
||||||
- name: Upload a Build Artifact
|
- name: Upload a Build Artifact
|
||||||
uses: actions/upload-artifact@v3.1.2
|
uses: actions/upload-artifact@v3.1.2
|
||||||
with:
|
with:
|
||||||
# Artifact name
|
# Artifact name
|
||||||
name: nix-actions-cache-x86_64-linux
|
name: nix-actions-cache-macOS
|
||||||
path: target/release/nix-actions-cache
|
path: target/release/nix-actions-cache
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
|
check-artifacts-macOS:
|
||||||
|
runs-on: macos-12
|
||||||
|
needs: build-artifacts-macOS
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: nix-actions-cache-macOS
|
||||||
|
path: cache-binary
|
||||||
|
- name: Make the binary executable
|
||||||
|
run: chmod +x ./cache-binary/nix-actions-cache
|
||||||
|
- uses: DeterminateSystems/nix-installer-action-cache@main
|
||||||
|
with:
|
||||||
|
cache-binary: ./cache-binary/nix-actions-cache
|
||||||
|
|
||||||
|
- name: "Build something"
|
||||||
|
run: "nix develop -c date"
|
||||||
|
|
||||||
|
build-artifacts-Linux:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: DeterminateSystems/nix-installer-action-cache@main
|
||||||
|
|
||||||
|
- name: "Build something"
|
||||||
|
run: "nix develop -c cargo build --release --target x86_64-unknown-linux-musl"
|
||||||
|
|
||||||
|
- name: Upload a Build Artifact
|
||||||
|
uses: actions/upload-artifact@v3.1.2
|
||||||
|
with:
|
||||||
|
# Artifact name
|
||||||
|
name: nix-actions-cache-Linux
|
||||||
|
path: target/x86_64-unknown-linux-musl/release/nix-actions-cache
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
check-artifacts-Linux:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
needs: build-artifacts-Linux
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: nix-actions-cache-Linux
|
||||||
|
path: cache-binary
|
||||||
|
- name: Make the binary executable
|
||||||
|
run: chmod +x ./cache-binary/nix-actions-cache
|
||||||
|
- uses: DeterminateSystems/nix-installer-action-cache@main
|
||||||
|
with:
|
||||||
|
cache-binary: ./cache-binary/nix-actions-cache
|
||||||
|
|
||||||
|
- name: "Build something"
|
||||||
|
run: "nix develop -c date"
|
||||||
|
|
3
.github/workflows/keygen.yaml
vendored
3
.github/workflows/keygen.yaml
vendored
|
@ -6,8 +6,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Install Nix
|
- uses: DeterminateSystems/nix-installer-action-cache@main
|
||||||
uses: DeterminateSystems/nix-installer-action@v2
|
|
||||||
- name: Expose GitHub Runtime
|
- name: Expose GitHub Runtime
|
||||||
uses: crazy-max/ghaction-github-runtime@v2
|
uses: crazy-max/ghaction-github-runtime@v2
|
||||||
- name: Dump credentials
|
- name: Dump credentials
|
||||||
|
|
|
@ -83,9 +83,10 @@
|
||||||
cargo-bloat
|
cargo-bloat
|
||||||
cargo-edit
|
cargo-edit
|
||||||
cargo-udeps
|
cargo-udeps
|
||||||
|
]
|
||||||
age
|
++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.frameworks.Security
|
||||||
];
|
++ lib.optional stdenv.hostPlatform.isDarwin (libiconv.override { enableStatic = true; enableShared = false; })
|
||||||
|
;
|
||||||
} // cargoCrossEnvs);
|
} // cargoCrossEnvs);
|
||||||
keygen = pkgs.mkShellNoCC {
|
keygen = pkgs.mkShellNoCC {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
|
|
Loading…
Reference in a new issue