Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: refactor monthly.yml to use same build steps #27

Merged
merged 2 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions .github/workflows/monthly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@ on:
schedule:
- cron: "53 15 18 * *" # AEST 1:53 am on 18th day each month
workflow_dispatch:
inputs:
push: { type: boolean, default: false, required: false }

env:
COMMIT: ${{ github.sha }}

jobs:
flake-update:
runs-on: ubuntu-latest

outputs:
patches: ${{ steps.data.outputs.b64 }}

steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
Expand All @@ -21,6 +30,23 @@ jobs:
nix flake update --commit-lock-file
- run: |
nix run github:katrinafyi/nix-patcher -- --commit --update

- run: |
nix build .#all -Lv
- run: git push
git format-patch $COMMIT -o new-patches

- name: Encode patches
id: data
run: |
touch patches.tar.zst
[[ -d new-patches ]] && (cd new-patches && tar caf ../patches.tar.zst .)
(printf 'b64=' && base64 -w0 patches.tar.zst && echo) >> "$GITHUB_OUTPUT"
ls -lh *.tar*

monthly-build:
if: always()
needs: [ flake-update ]
uses: ./.github/workflows/main.yml
with:
patches-b64: ${{ needs.flake-update.outputs.patches }}
push: ${{ inputs.push || github.event_name == 'schedule' }}
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
(printf 'b64=' && base64 -w0 patches.tar.zst && echo) >> "$GITHUB_OUTPUT"
ls -lh *.tar*

build:
update-build:
if: always()
needs: [ collate ]
uses: ./.github/workflows/main.yml
Expand Down
Loading