From b56d821cc0e4592abea4775fdbf2314240cc4549 Mon Sep 17 00:00:00 2001 From: Chris Schinnerl Date: Fri, 9 Feb 2024 09:49:31 +0100 Subject: [PATCH] build.yml: separate create-pull-request job --- .github/workflows/build.yml | 63 ++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ec03b7a7..f213d241 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,9 +57,6 @@ jobs: run: | echo "${{ secrets.GPG_SIGNING_KEY }}" | base64 --decode | gpg --import - - name: Checkout repo - uses: actions/checkout@v3 - - name: Download release artifacts from workflow uses: dawidd6/action-download-artifact@v3 with: @@ -123,28 +120,42 @@ jobs: # Build the .deb file echo "Building ${BUILD_NAME}.deb" dpkg-deb --build ${BUILD_NAME} - - # Remove the folder - rm -rf ${BUILD_NAME} done - - - name: Add packages to repository - shell: bash - run: | - IFS=':' read -r -a parts <<< "${{ matrix.distro }}" - reprepro -Vb ./${parts[0]} includedeb ${parts[1]} *.deb - - - name: Clean up - run: | - rm *.deb - rm -rf ./artifacts - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 + + - name: upload deb packages + uses: actions/upload-artifact@v4 with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: '${{ env.PROJECT }}: ${{ env.RELEASE_TAG }}' - title: '${{ env.PROJECT }}: ${{ env.RELEASE_TAG }}' - body: 'This is an automated PR to update ${{ env.PROJECT }} to ${{ env.RELEASE_TAG }}' - branch: ${{ env.PROJECT }}/update - base: master + name: ${{ matrix.distro }} + path: *.deb + + create-pull-request: + needs: build + runs-on: ubuntu-latest + steps: + - name: Download deb packages + uses: actions/download-artifact@v4 + with: + path: ./packages + + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Add packages to repository + shell: bash + run: | + for distro in ./packages; do + IFS=':' read -r -a parts <<< ${distro} + reprepro -Vb ./${parts[0]} includedeb ${parts[1]} ./packages/${distro}/*.deb + done + + rm -rf ./packages + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: '${{ env.PROJECT }}: ${{ env.RELEASE_TAG }}' + title: '${{ env.PROJECT }}: ${{ env.RELEASE_TAG }}' + body: 'This is an automated PR to update ${{ env.PROJECT }} to ${{ env.RELEASE_TAG }}' + branch: ${{ env.PROJECT }}/update + base: master