Swap out hardcoded revision for Cargo.toml variable
All checks were successful
Run Tests on Code / run-tests (push) Successful in 12s

This commit is contained in:
Neshura 2023-12-29 00:04:01 +01:00
parent 846e07b56c
commit 9e3415f890
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C
3 changed files with 9 additions and 4 deletions

View file

@ -67,7 +67,10 @@ jobs:
run: | run: |
cargo deb cargo deb
DEBIAN_REF=$(echo ${{ github.ref_name }} | tr - \~) 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 name: Uploading Build Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
@ -96,12 +99,12 @@ jobs:
- -
name: Upload Debian Package name: Upload Debian Package
run: | run: |
DEBIAN_REF=$(echo ${{ github.ref_name }} | tr - \~) source release_blobs/build.env
echo 'curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \ 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' https://forgejo.neshweb.net/api/packages/${{ secrets.FORGEJO_USERNAME }}/debian/pool/bookworm/main/upload'
curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \ 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 https://forgejo.neshweb.net/api/packages/${{ secrets.FORGEJO_USERNAME }}/debian/pool/bookworm/main/upload
- -
name: Release New Version name: Release New Version

View file

@ -6,6 +6,8 @@ edition = "2021"
description = "Application for automatically updating Cloudflare DNS records" description = "Application for automatically updating Cloudflare DNS records"
license = "GPL-3.0-or-later" 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 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]