name: build on: pull_request: branches: - main jobs: build: strategy: matrix: package: - akkoma - pleroma-fe - admin-fe - emoji-lotte - emoji-volpeon-blobfox - emoji-volpeon-blobfox-flip - emoji-volpeon-bunhd - emoji-volpeon-bunhd-flip - emoji-volpeon-drgn - emoji-volpeon-fox - emoji-volpeon-gphn - emoji-volpeon-raccoon - emoji-volpeon-vlpn - emoji-caro - lotte-art - drone-runner-docker - alco-sans - constructium - fairfax - fairfax-hd - kreative-square - nasin-nanpa - matrix-media-repo - mautrix-discord - mautrix-whatsapp - mautrix-signal - mautrix-telegram - python-mautrix - python-tulir-telethon - papermc - python-plover-stroke - python-rtf-tokenize - plover - plover-plugins-manager - python-simplefuzzyset - plover-plugin-emoji - plover-plugin-tapey-tape - plover-plugin-yaml-dictionary - plover-plugin-machine-hid - plover-plugin-rkb1-hid - plover-dict-didoesdigital - miifox-net - old-homepage - clean-s3-cache - python-instagram - moa - nix-s3-dedup - attic - attic-client - attic-server runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 - name: Install Nix uses: cachix/install-nix-action@v18 with: nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nixcache:8KKuGz95Pk4UJ5W/Ni+pN+v+LDTkMMFV4yrGmAYgkDg= hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs= cache:6tx18bfuH66LOfrn37EmN2YxwNZI3qNk3lKHoz/XlXI= experimental-features = nix-command flakes ca-derivations post-build-hook = ${{ github.workspace }}/scripts/post-build-hook substituters = https://cache.chir.rs/ https://cache.nixos.org/ https://attic.chir.rs/cache - name: Download patched nix run: nix build github:DarkKirb/nix-packages#nix-s3-dedup - name: Download attic run: nix build github:DarkKirb/nix-packages#attic-client - name: Set up secrets run: | echo "$NIX_CACHE_KEY" > ~/cache.key sudo mkdir /root/.aws echo "$AWS_CREDENTIALS" | sudo tee /root/.aws/credentials > /dev/null nix run github:DarkKirb/nix-packages#attic-client -- login attic-server https://attic.chir.rs/ "$ATTIC_TOKEN" env: NIX_CACHE_KEY: ${{secrets.NIX_CACHE_KEY}} AWS_CREDENTIALS: ${{secrets.AWS_CREDENTIALS}} ATTIC_TOKEN: ${{secrets.ATTIC_TOKEN}} - name: install jq run: sudo apt install jq - name: Build ${{ matrix.package }} run: | DRV_PATH=$(nix-instantiate -E '(import ./. {}).${{ matrix.package }}') OUT_PATH=$(nix show-derivation $DRV_PATH | jq -r ".\"$DRV_PATH\".outputs.out.path") # check if we already built it NARINFO=$(echo $OUT_PATH | sed 's|/| |g' | sed 's|-| |g' | awk '{print $3}') if curl --output /dev/null --silent --fail "https://cache.chir.rs/$NARINFO.narinfo"; then echo "${{ matrix.package }} already built. Skipping" else sudo /nix/var/nix/profiles/default/bin/nix run 'github:DarkKirb/nix-packages#attic-client' -- push cache $(nix-store -r $DRV_PATH) fi env: NIXPKGS_ALLOW_UNFREE: 1