All checks were successful
Publish packages to Attic / publish (push) Successful in 11m28s
i forgor
77 lines
2.1 KiB
YAML
77 lines
2.1 KiB
YAML
name: Publish packages to Attic
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
ATTIC_SERVER: ${{ secrets.ATTIC_SERVER }}
|
|
ATTIC_CACHE: ${{ secrets.ATTIC_CACHE }}
|
|
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
|
# NIX_CONFIG: experimental-features = nix-command flakes
|
|
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install upstream Nix
|
|
uses: cachix/install-nix-action@v31
|
|
|
|
- name: Install Attic client
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
if command -v attic >/dev/null 2>&1; then
|
|
exit 0
|
|
fi
|
|
|
|
nix profile add --accept-flake-config nixpkgs#attic-client
|
|
echo "$HOME/.nix-profile/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Configure Attic
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
: "${ATTIC_SERVER:?Set the ATTIC_SERVER secret to your Attic API base URL}"
|
|
: "${ATTIC_CACHE:?Set the ATTIC_CACHE secret to the destination cache name}"
|
|
: "${ATTIC_TOKEN:?Set the ATTIC_TOKEN secret to a token with push access}"
|
|
|
|
export PATH="$HOME/.nix-profile/bin:$PATH"
|
|
|
|
attic login --set-default ci "$ATTIC_SERVER" "$ATTIC_TOKEN"
|
|
attic use "$ATTIC_CACHE"
|
|
|
|
- name: Prepare builds
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
sudo rm -rf /homeless-shelter || rm -rf /homeless-shelter
|
|
|
|
- name: Build packages
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
system="$(nix eval --impure --raw --expr builtins.currentSystem)"
|
|
|
|
nix build --accept-flake-config --no-link --print-out-paths -L \
|
|
".#packages.${system}.musicpresence" \
|
|
".#packages.${system}.vintage-story" \
|
|
".#packages.${system}.swaytreesave" \
|
|
| tee built-paths.txt
|
|
|
|
- name: Push packages to Attic
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
export PATH="$HOME/.nix-profile/bin:$PATH"
|
|
xargs -r attic push "$ATTIC_CACHE" < built-paths.txt
|