build packages and push cache #44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build packages and push cache | |
| on: | |
| push: | |
| branches: | |
| - master | |
| schedule: | |
| - cron: "0 6 * * *" | |
| jobs: | |
| packages-default: | |
| env: | |
| NIXPKGS_OVERRIDE: "" | |
| strategy: | |
| matrix: &platform_matrix | |
| platform: | |
| - name: linux-x64-self-hosted | |
| runs-on: | |
| - self-hosted | |
| - Linux | |
| - X64 | |
| - name: linux-arm64-self-hosted | |
| runs-on: | |
| - self-hosted | |
| - Linux | |
| - ARM64 | |
| - name: macos-arm64 | |
| runs-on: macos-14 | |
| runs-on: ${{ matrix.platform.runs-on }} | |
| steps: &build_steps | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| clean: true | |
| - name: Install nix | |
| uses: cachix/install-nix-action@v31 | |
| with: | |
| extra_nix_config: | | |
| experimental-features = nix-command flakes | |
| access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Cachix | |
| uses: cachix/cachix-action@v16 | |
| with: | |
| name: pspdev | |
| authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
| - name: Build nix packages | |
| run: | | |
| system="$(nix eval --impure --raw --expr builtins.currentSystem)" | |
| nix build \ | |
| ".#checks.${system}.build" \ | |
| --print-build-logs \ | |
| ${{ env.NIXPKGS_OVERRIDE }} | |
| packages-unstable: | |
| if: ${{ github.event_name != 'schedule' }} | |
| needs: packages-default | |
| env: | |
| NIXPKGS_OVERRIDE: --override-input nixpkgs github:NixOS/nixpkgs/nixos-unstable | |
| strategy: | |
| matrix: *platform_matrix | |
| runs-on: ${{ matrix.platform.runs-on }} | |
| steps: *build_steps | |
| packages-master: | |
| if: ${{ github.event_name != 'schedule' }} | |
| needs: packages-unstable | |
| env: | |
| NIXPKGS_OVERRIDE: --override-input nixpkgs github:NixOS/nixpkgs/master | |
| strategy: | |
| matrix: *platform_matrix | |
| runs-on: ${{ matrix.platform.runs-on }} | |
| steps: *build_steps |