Don't attic push on PRs from forks #29
This file contains 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 Nix packages for various platforms" | |
on: | |
push: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
system: x86_64-linux | |
- os: macos-latest | |
system: x86_64-darwin | |
- os: macos-latest | |
system: aarch64-darwin | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v27 | |
with: | |
github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
nix_path: nixpkgs=channel:nixos-unstable | |
extra_nix_config: | | |
experimental-features = nix-command flakes | |
extra-platforms = x86_64-linux x86_64-darwin aarch64-darwin | |
accept-flake-config = true | |
- name: Install Rosetta | |
if: ${{ contains(matrix.system, 'x86_64-darwin') }} | |
run: sudo softwareupdate --install-rosetta --agree-to-license | |
- name: Install attic | |
run: | | |
nix run nixpkgs#attic-client login internal "https://attic.internal.moonvision.io" "${{ secrets.ATTIC_SECRET_KEY }}" | |
nix run nixpkgs#attic-client use moonvision-foss | |
- name: Building package | |
run: nix build .#packages.${{ matrix.system }}.default | |
- name: Push result to cache | |
if: ${{ github.event.pull_request.head.repo.full_name == 'MoonVision/jira-tools' }} | |
run: nix run nixpkgs#attic-client push moonvision-foss result |