diff --git a/.forgejo/workflows/build+release.yml b/.forgejo/workflows/build+release.yml index a9abeec..34ddd5e 100644 --- a/.forgejo/workflows/build+release.yml +++ b/.forgejo/workflows/build+release.yml @@ -67,7 +67,10 @@ jobs: run: | cargo deb DEBIAN_REF=$(echo ${{ github.ref_name }} | tr - \~) - mv target/debian/${{ github.event.repository.name }}_$DEBIAN_REF-1_amd64.deb dist/${{ github.event.repository.name }}_$DEBIAN_REF-1_amd64.deb + echo "DEBIAN_REF=$DEBIAN_REF" >> dist/build.env + DEBIAN_REV=-$(cat Cargo.toml | grep -E "(^|\|)version =" | cut -f2- -d= | tr -d \" | tr -d " ") + echo "DEBIAN_REV=$DEBIAN_REV" >> dist/build.env + mv target/debian/${{ github.event.repository.name }}_"$DEBIAN_REF""$DEBIAN_REV"_amd64.deb dist/${{ github.event.repository.name }}_"$DEBIAN_REF""$DEBIAN_REV"_amd64.deb - name: Uploading Build Artifact uses: actions/upload-artifact@v3 @@ -96,12 +99,12 @@ jobs: - name: Upload Debian Package run: | - DEBIAN_REF=$(echo ${{ github.ref_name }} | tr - \~) + source release_blobs/build.env echo 'curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \ - --upload-file release_blobs/${{ github.event.repository.name }}_$DEBIAN_REF-1_amd64.deb \ + --upload-file release_blobs/${{ github.event.repository.name }}_"$DEBIAN_REF""$DEBIAN_REV"_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/${{ github.event.repository.name }}_$DEBIAN_REF-1_amd64.deb \ + --upload-file release_blobs/${{ github.event.repository.name }}_"$DEBIAN_REF""$DEBIAN_REV"_amd64.deb \ https://forgejo.neshweb.net/api/packages/${{ secrets.FORGEJO_USERNAME }}/debian/pool/bookworm/main/upload - name: Release New Version diff --git a/Cargo.toml b/Cargo.toml index b59af23..c42346e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,8 @@ edition = "2021" description = "Application for automatically updating Cloudflare DNS records" license = "GPL-3.0-or-later" +[package.metadata.deb] +revision = "1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/unit-scripts/cloudflare-dns-updater.service b/unit-scripts/cloudflare-dns-updater.service new file mode 100644 index 0000000..e69de29