From 54d03b80659a40e34f4ae5bf6011807fcf30bd68 Mon Sep 17 00:00:00 2001 From: Paulchen-Panther <16664240+Paulchen-Panther@users.noreply.github.com> Date: Sun, 14 May 2023 16:29:57 +0200 Subject: [PATCH] added workflow_dispatch to allow the bot to create the APT repository itself --- .github/workflows/apt.yml | 27 +++++++++++++++++++++++++-- .github/workflows/push-master.yml | 8 +++----- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/apt.yml b/.github/workflows/apt.yml index 41cc80f9..06212416 100644 --- a/.github/workflows/apt.yml +++ b/.github/workflows/apt.yml @@ -1,6 +1,26 @@ name: Hyperion APT Build on: workflow_call: + inputs: + head_sha: + type: string + description: The branch, tag or SHA to checkout + required: true + secrets: + APT_GPG: + required: true + APT_USER: + required: true + APT_PASSWORD: + required: true + APT_DRAFT: + required: true + workflow_dispatch: + inputs: + head_sha: + type: string + description: The branch, tag or SHA to checkout + required: true secrets: APT_GPG: required: true @@ -36,6 +56,7 @@ jobs: steps: - uses: actions/checkout@v3 with: + ref: ${{ github.event.inputs.head_sha || github.event.client_payload.head_sha }} submodules: true - name: Generate environment variables @@ -73,7 +94,7 @@ jobs: cp ../hyperion_*.deb /deploy" - name: Upload package artifact - if: startsWith(github.event.ref, 'refs/tags') + if: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'workflow_dispatch' }} uses: actions/upload-artifact@v3 with: path: deploy @@ -81,12 +102,14 @@ jobs: publish: name: Publish APT packages - if: startsWith(github.event.ref, 'refs/tags') + if: ${{ startsWith(github.event.ref, 'refs/tags') || github.event_name == 'workflow_dispatch' }} needs: [setup, build] runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.head_sha || github.event.client_payload.head_sha }} - name: Import GPG key uses: crazy-max/ghaction-import-gpg@v5.2.0 diff --git a/.github/workflows/push-master.yml b/.github/workflows/push-master.yml index c820a447..dc290a5b 100644 --- a/.github/workflows/push-master.yml +++ b/.github/workflows/push-master.yml @@ -195,8 +195,6 @@ jobs: if: startsWith(github.event.ref, 'refs/tags') needs: [Linux, macOS, windows] uses: ./.github/workflows/apt.yml - secrets: - APT_GPG: ${{ secrets.APT_GPG }} - APT_USER: ${{ secrets.APT_USER }} - APT_PASSWORD: ${{ secrets.APT_PASSWORD }} - APT_DRAFT: ${{ secrets.APT_DRAFT }} + secrets: inherit + with: + head_sha: master