From f2241f371fe44ce09b9f24eb76dd97f18ede6ef8 Mon Sep 17 00:00:00 2001 From: rina Date: Wed, 4 Sep 2024 10:38:24 +1000 Subject: [PATCH] b64 input --- .github/workflows/main.yml | 26 +++++++++++++++++--------- .github/workflows/update.yml | 15 +++++---------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ed679e4..e670237 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,15 +6,15 @@ on: workflow_dispatch: inputs: push: { type: boolean, default: false } - run-id: + patches-b64: { type: string, required: false } workflow_call: inputs: push: { type: boolean, default: false, required: false } - patches-url: { type: string, required: false } + patches-b64: { type: string, required: false } jobs: update-check: - if: ${{ ! inputs.patches-url }} + if: ${{ ! inputs.patches-b64 }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -46,13 +46,17 @@ jobs: with: { name: pac-nix, authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}', skipPush: "${{ github.ref != 'refs/heads/main' }}" } - name: Apply staged patch commits - if: ${{ inputs.patches-url }} + if: ${{ inputs.patches-b64 }} run: | shopt -s nullglob set -x - wget -O patches.zip '${{ inputs.patches-url }}' - unzip patches.zip -d prev-patches + cat < patches.tar.zst + ${{ inputs.patches-b64 }} + EOF + + mkdir prev-patches + tar xaf ../patches.tar.zst -C prev-patches git config user.name 'github-actions[bot]' git config user.email '41898282+github-actions[bot]@users.noreply.github.com' @@ -99,13 +103,17 @@ jobs: [[ $result == success || $result == skipped ]] - name: Apply staged patch commits - if: ${{ inputs.patches-url }} + if: ${{ inputs.patches-b64 }} run: | shopt -s nullglob set -x - wget -O patches.zip '${{ inputs.patches-url }}' - unzip patches.zip -d prev-patches + cat < patches.tar.zst + ${{ inputs.patches-b64 }} + EOF + + mkdir prev-patches + tar xaf ../patches.tar.zst -C prev-patches git config user.name 'github-actions[bot]' git config user.email '41898282+github-actions[bot]@users.noreply.github.com' diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 175bce4..69e3c74 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -63,7 +63,7 @@ jobs: runs-on: ubuntu-latest needs: [ update ] outputs: - url: ${{ steps.public.outputs.url }} + patches: ${{ steps.data.outputs.b64 }} steps: - uses: actions/download-artifact@v4 with: @@ -76,28 +76,23 @@ jobs: name: 'partial-patches-*' - uses: actions/upload-artifact@v4 - id: upload with: name: all-patches path: prev-patches if-no-files-found: ignore - name: Re-upload to public site - id: public + id: data run: | set -x - (cd prev-patches && zip -r ../patches.zip .) - # accessing github actions artifacts too hard... - url="$(curl -F'file=@patches.zip' https://0x0.st)" - echo "$url" - [[ -n "$url" ]] - echo "url=$url" >> "$GITHUB_OUTPUT" + (cd prev-patches && tar caf ../patches.tar.zst .) + (printf 'b64=' && base64 -w0 patches.tar.zst && echo) >> "$GITHUB_OUTPUT" build: needs: [ collate ] uses: ./.github/workflows/main.yml with: - patches-url: ${{ needs.collate.outputs.url }} + patches-b64: ${{ needs.collate.outputs.patches }} push: ${{ inputs.push || github.event_name == 'schedule' }} secrets: inherit