From 2844d6b963b712e7689f2d6d369ff521b3c76334 Mon Sep 17 00:00:00 2001 From: Neshura Date: Thu, 28 Dec 2023 22:48:33 +0100 Subject: [PATCH] Debian packaging added to release actions --- .forgejo/workflows/build+release.yml | 44 ++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/.forgejo/workflows/build+release.yml b/.forgejo/workflows/build+release.yml index 33b38f2..c294c74 100644 --- a/.forgejo/workflows/build+release.yml +++ b/.forgejo/workflows/build+release.yml @@ -51,17 +51,31 @@ jobs: - name: Checking Out Repository Code uses: https://code.forgejo.org/actions/checkout@v3 + - + name: Installing cargo-deb dependencies + run: apt install -y liblzma-dev + - + name: Installing cargo-deb + run: | + cargo install cargo-deb - name: Compiling To Linux Target run: | cargo build -r - mv target/release/cloudflare-dns-updater cloudflare-dns-updater-linux-amd64 + mv target/release/cloudflare-dns-updater cloudflare-dns-updater-linux-amd64 + - + name: Bundle .deb package + run: | + cargo deb + mv target/debian/cloudflare-dns-updater_${{ github.ref_name }}-1_amd64.deb cloudflare-dns-updater_${{ github.ref_name }}-1_amd64.deb - name: Uploading Build Artifact uses: actions/upload-artifact@v3 with: - name: cloudflare-dns-updater-linux-amd64 - path: cloudflare-dns-updater-linux-amd64 + name: release_blobs + path: | + cloudflare-dns-updater-linux-amd64 + cloudflare-dns-updater_${{ github.ref_name }}-1_amd64.deb if-no-files-found: error upload-release: @@ -73,25 +87,29 @@ jobs: name: Downloading All Build Artifacts uses: actions/download-artifact@v3 - - name: Rearrange Artifact Paths - run: | - mkdir release - mv cloudflare-dns-updater-linux-amd64/cloudflare-dns-updater-linux-amd64 release/cloudflare-dns-updater-linux-amd64 - - - name: Upload Artifacts As Generic Packages + name: Upload Binary run: | echo 'curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \ - --upload-file release/cloudflare-dns-updater-linux-amd64 \ + --upload-file release_blobs/cloudflare-dns-updater-linux-amd64 \ https://forgejo.neshweb.net/api/packages/${{ secrets.FORGEJO_USERNAME }}/generic/${{ github.event.repository.name }}/${{ github.ref_name }}/chellaris-rust-api-linux-amd64' curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \ - --upload-file release/cloudflare-dns-updater-linux-amd64 \ - https://forgejo.neshweb.net/api/packages/${{ secrets.FORGEJO_USERNAME }}/generic/${{ github.event.repository.name }}/${{ github.ref_name }}/chellaris-rust-api-linux-amd64 + --upload-file release_blobs/cloudflare-dns-updater-linux-amd64 \ + https://forgejo.neshweb.net/api/packages/${{ secrets.FORGEJO_USERNAME }}/generic/${{ github.event.repository.name }}/${{ github.ref_name }}/chellaris-rust-api-linux-amd64 + - + name: Upload Debian Package + run: | + echo 'curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \ + --upload-file release_blobs/cloudflare-dns-updater_${{ github.ref_name }}-1_amd64.deb \ + https://forgejo.neshweb.net/api/packages/${{ secrets.FORGEJO_USERNAME }}/debian/pool/bookworm/main/upload' + curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \ + --upload-file release_blobs/cloudflare-dns-updater_${{ github.ref_name }}-1_amd64.deb \ + https://forgejo.neshweb.net/api/packages/${{ secrets.FORGEJO_USERNAME }}/debian/pool/bookworm/main/upload - name: Release New Version uses: actions/forgejo-release@v1 with: direction: upload url: https://forgejo.neshweb.net - release-dir: release + release-dir: release_blobs token: ${{ secrets.FORGEJO_TOKEN }} tag: ${{ github.ref_name }} \ No newline at end of file