Skip to content

Commit

Permalink
build.yml: separate create-pull-request job
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Feb 9, 2024
1 parent f1427de commit b56d821
Showing 1 changed file with 37 additions and 26 deletions.
63 changes: 37 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

0 comments on commit b56d821

Please sign in to comment.