oizys/.github/workflows/update.yml

162 lines
4 KiB
YAML
Raw Normal View History

2024-07-16 12:41:05 -05:00
name: Flake Update / Build
2024-07-11 16:31:51 -05:00
on:
workflow_dispatch:
schedule:
2024-10-23 10:28:34 -05:00
# At minute 00:00 on Monday, Wednesday, and Friday.
- cron: 0 0 * * 1,3,5
2024-07-11 16:31:51 -05:00
2024-07-11 23:33:26 -05:00
permissions:
contents: write
2024-07-11 16:31:51 -05:00
2024-08-09 13:05:34 -05:00
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
2024-07-11 16:31:51 -05:00
jobs:
2024-07-11 23:33:26 -05:00
build-minimal:
2024-07-11 16:31:51 -05:00
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
2024-11-04 12:27:17 -06:00
# needed to access ghostty repo for now
2024-11-03 09:33:36 -06:00
- name: Setup SSH
2024-11-04 12:27:17 -06:00
uses: MrSquaare/ssh-setup-action@v3
2024-11-03 09:33:36 -06:00
with:
host: github.com
private-key: ${{ secrets.SSH_PRIVATE_KEY }}
2024-07-25 15:06:45 -05:00
- uses: daylin-bot/actions/setup@main
2024-08-01 12:29:07 -05:00
- uses: ./.github/actions/clean-disk
2024-07-25 15:06:45 -05:00
- run: git checkout -B flake-lock
2024-07-11 16:31:51 -05:00
- uses: DeterminateSystems/nix-installer-action@v15
2024-07-11 16:31:51 -05:00
with:
2024-08-06 10:22:27 -05:00
source-url: https://install.lix.systems/lix/lix-installer-x86_64-linux
2024-07-11 16:31:51 -05:00
extra-conf: |
experimental-features = pipe-operator
2024-07-11 16:31:51 -05:00
accept-flake-config = true
2024-10-29 17:08:20 -05:00
- name: Install and login to attic cache
2024-10-29 16:59:11 -05:00
run: |
2024-10-29 17:08:20 -05:00
nix profile install "nixpkgs#attic-client"
attic login oizys https://attic.dayl.in "${{ secrets.ATTIC_TOKEN }}"
2024-10-29 16:59:11 -05:00
# - uses: cachix/cachix-action@v15
# with:
# name: daylin
# authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
2024-07-11 16:31:51 -05:00
- name: Update nix flake
2024-07-11 23:38:18 -05:00
run: |
nix flake update --commit-lock-file
2024-10-04 14:37:10 -05:00
printf '# Flake Lock\n\n```txt\n%s```\n' \
"$(git show -s --format='%B')" \
>> $GITHUB_STEP_SUMMARY
2024-07-11 16:31:51 -05:00
2024-08-07 13:07:38 -05:00
- name: Pre-build oizys
2024-11-03 09:48:13 -06:00
run: |
nix build .
attic push oizys result
2024-08-07 13:07:38 -05:00
2024-07-11 16:31:51 -05:00
- name: Build
2024-08-28 10:31:00 -05:00
run: >
nix run .
--
2024-10-29 16:59:11 -05:00
cache
2024-08-28 10:31:00 -05:00
--host "othalan"
--flake .
--debug
2024-11-04 12:42:19 -06:00
--
--print-build-logs
2024-07-11 23:33:26 -05:00
- name: Commit Updates
2024-07-25 15:06:45 -05:00
uses: daylin-bot/actions/commit-and-push@main
with:
push-args: --set-upstream --force origin flake-lock
2024-07-11 23:33:26 -05:00
build-full:
needs: build-minimal
runs-on: ubuntu-latest
2024-07-18 09:09:56 -05:00
strategy:
2024-09-13 09:35:42 -05:00
fail-fast: false
2024-07-18 09:09:56 -05:00
matrix:
host:
- othalan
- algiz
- mannaz
- naudiz
2024-07-11 23:33:26 -05:00
steps:
- name: Checkout
uses: actions/checkout@v4
2024-07-15 15:37:35 -05:00
with:
fetch-depth: 0
2024-07-11 23:33:26 -05:00
2024-11-04 13:55:45 -06:00
# needed to access ghostty repo for now
2024-11-03 15:10:56 -06:00
- name: Setup SSH
2024-11-04 13:55:45 -06:00
uses: MrSquaare/ssh-setup-action@v3
2024-11-03 15:10:56 -06:00
with:
host: github.com
private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- uses: DeterminateSystems/nix-installer-action@v15
2024-07-11 23:33:26 -05:00
with:
2024-08-06 12:43:56 -05:00
source-url: https://install.lix.systems/lix/lix-installer-x86_64-linux
2024-07-11 23:33:26 -05:00
extra-conf: |
experimental-features = pipe-operator
2024-07-11 23:33:26 -05:00
accept-flake-config = true
- uses: ./.github/actions/clean-disk
with:
purge-packages: 'true'
2024-08-07 13:07:38 -05:00
- name: Pre-build oizys
run: nix build .
2024-07-18 09:09:56 -05:00
2024-07-11 23:33:26 -05:00
- name: Build
2024-09-05 23:19:34 -05:00
run: >
nix run .
2024-09-09 08:18:12 -05:00
--
build
"$(nix run . -- output --host "${{ matrix.host }}" --flake .)"
--flake .
--debug
--
--keep-going
--print-build-logs
--out-link current
2024-09-05 23:19:34 -05:00
2024-07-15 12:52:21 -05:00
2024-07-15 14:52:10 -05:00
- run: git checkout flake-lock
2024-07-15 12:52:21 -05:00
2024-08-07 13:07:38 -05:00
- name: Pre-build oizys
run: nix build .
2024-07-15 12:52:21 -05:00
- name: Build Updated
2024-09-05 23:19:34 -05:00
run: >
nix run .
2024-09-09 08:18:12 -05:00
--
build
"$(nix run . -- output --host "${{ matrix.host }}" --flake .)"
--flake .
--debug
--
--keep-going
--print-build-logs
--out-link updated
2024-07-15 13:25:30 -05:00
- run: |
echo "# System Diff" >> $GITHUB_STEP_SUMMARY
2024-07-17 12:34:27 -05:00
nix run "nixpkgs#nvd" -- --color always diff ./current ./updated >> summary.md
2024-09-17 16:05:50 -05:00
printf '```\n%s\n```\n' "$(nix run "nixpkgs#nvd" -- diff ./current ./updated)" >> $GITHUB_STEP_SUMMARY
2024-07-16 12:20:24 -05:00
2024-07-15 13:31:02 -05:00
- run: df -h
2024-07-15 15:19:28 -05:00
- uses: actions/upload-artifact@v4
with:
2024-07-18 09:09:56 -05:00
name: ${{ matrix.host }}-summary
2024-07-15 15:19:28 -05:00
path: summary.md