CI Cross-Job Var Fix Attempt
Some checks failed
Run Tests on Code / run-tests (push) Successful in 12s
Build binary file and bundle packages / test (pull_request) Successful in 11s
Build binary file and bundle packages / build (pull_request) Successful in 28s
Build binary file and bundle packages / test-env (pull_request) Failing after 0s

This commit is contained in:
Neshura 2024-08-07 19:48:40 +02:00
parent 99a7811459
commit 713bbb550a
Signed by: Neshura
GPG key ID: 4E2D47B1374C297D
2 changed files with 31 additions and 6 deletions

View file

@ -47,6 +47,10 @@ jobs:
if: success() if: success()
runs-on: docker runs-on: docker
container: forgejo.neshweb.net/ci-docker-images/rust-node:latest container: forgejo.neshweb.net/ci-docker-images/rust-node:latest
outputs:
DEBIAN_NAME: ${{ steps.deb_bundle.outputs.debian_name }}
DEBIAN_REV: ${{ steps.deb_bundle.outputs.debian_rev }}
DEBIAN_REF: ${{ steps.deb_bundle.outputs.debian_ref }}
steps: steps:
- -
name: Checking Out Repository Code name: Checking Out Repository Code
@ -109,20 +113,20 @@ jobs:
name: Upload Debian Package to staging name: Upload Debian Package to staging
run: | run: |
echo 'curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \ echo 'curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \
--upload-file release_blobs/${{ steps.deb_bundle.outputs.debian_name }}_'${{ steps.deb_bundle.outputs.debian_ref }}${{ steps.deb_bundle.outputs.debian_rev }}'_amd64.deb \ --upload-file release_blobs/${{ needs.build.outputs.debian_name }}_'${{ needs.build.outputs.debian_ref }}${{ needs.build.outputs.debian_rev }}'_amd64.deb \
${{ env.GITHUB_API_URL }}/packages/${{ env.GITHUB_REPOSITORY_OWNER }}/debian/pool/bookworm/staging/upload' ${{ env.GITHUB_API_URL }}/packages/${{ env.GITHUB_REPOSITORY_OWNER }}/debian/pool/bookworm/staging/upload'
curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \ curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \
--upload-file release_blobs/${{ steps.deb_bundle.outputs.debian_name }}_${{ steps.deb_bundle.outputs.debian_ref }}${{ steps.deb_bundle.outputs.debian_rev }}_amd64.deb \ --upload-file release_blobs/${{ needs.build.outputs.debian_name }}_${{ needs.build.outputs.debian_ref }}${{ needs.build.outputs.debian_rev }}_amd64.deb \
${{ env.GITHUB_API_URL }}/packages/${{ env.GITHUB_REPOSITORY_OWNER }}/debian/pool/bookworm/staging/upload ${{ env.GITHUB_API_URL }}/packages/${{ env.GITHUB_REPOSITORY_OWNER }}/debian/pool/bookworm/staging/upload
- -
name: Upload Debian Package to main name: Upload Debian Package to main
if: (! contains(github.ref_name, '-rc')) if: (! contains(github.ref_name, '-rc'))
run: | run: |
echo 'curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \ echo 'curl -v --user ${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }} \
--upload-file release_blobs/${{ steps.deb_bundle.outputs.debian_name }}_'${{ steps.deb_bundle.outputs.debian_ref }}${{ steps.deb_bundle.outputs.debian_rev }}'_amd64.deb \ --upload-file release_blobs/${{ needs.build.outputs.debian_name }}_'${{ needs.build.outputs.debian_ref }}${{ needs.build.outputs.debian_rev }}'_amd64.deb \
${{ env.GITHUB_API_URL }}/packages/${{ env.GITHUB_REPOSITORY_OWNER }}/debian/pool/bookworm/main/upload' ${{ env.GITHUB_API_URL }}/packages/${{ env.GITHUB_REPOSITORY_OWNER }}/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/${{ steps.deb_bundle.outputs.debian_name }}_${{ steps.deb_bundle.outputs.debian_ref }}${{ steps.deb_bundle.outputs.debian_rev }}_amd64.deb \ --upload-file release_blobs/${{ needs.build.outputs.debian_name }}_${{ needs.build.outputs.debian_ref }}${{ needs.build.outputs.debian_rev }}_amd64.deb \
${{ env.GITHUB_API_URL }}/packages/${{ env.GITHUB_REPOSITORY_OWNER }}/debian/pool/bookworm/main/upload ${{ env.GITHUB_API_URL }}/packages/${{ env.GITHUB_REPOSITORY_OWNER }}/debian/pool/bookworm/main/upload
create-release: create-release:

View file

@ -37,6 +37,10 @@ jobs:
if: success() if: success()
runs-on: docker runs-on: docker
container: forgejo.neshweb.net/ci-docker-images/rust-node:latest container: forgejo.neshweb.net/ci-docker-images/rust-node:latest
outputs:
DEBIAN_NAME: ${{ steps.deb_bundle.outputs.debian_name }}
DEBIAN_REV: ${{ steps.deb_bundle.outputs.debian_rev }}
DEBIAN_REF: ${{ steps.deb_bundle.outputs.debian_ref }}
steps: steps:
- -
name: Checking Out Repository Code name: Checking Out Repository Code
@ -51,10 +55,15 @@ jobs:
mv target/release/${{ github.event.repository.name }} dist/${{ github.event.repository.name }}-linux-amd64 mv target/release/${{ github.event.repository.name }} dist/${{ github.event.repository.name }}-linux-amd64
- -
name: Bundle .deb package name: Bundle .deb package
id: deb_bundle
run: | run: |
cargo deb cargo deb
DEBIAN_REF=$(cat Cargo.toml | grep -E "(^|\|)version =" | cut -f2- -d= | tr -d \" | tr -d " " | tr - \~) DEBIAN_REF=$(echo ${{ github.ref_name }} | tr - \~)
echo "debian_ref=$DEBIAN_REF" >> ${{ env.GITHUB_OUTPUT }}
DEBIAN_REV=-$(cat Cargo.toml | grep -E "(^|\|)revision =" | cut -f2- -d= | tr -d \" | tr -d " ") DEBIAN_REV=-$(cat Cargo.toml | grep -E "(^|\|)revision =" | cut -f2- -d= | tr -d \" | tr -d " ")
echo "debian_rev=$DEBIAN_REV" >> ${{ env.GITHUB_OUTPUT }}
DEBIAN_NAME=-$(cat Cargo.toml | grep -E "(^|\|)name =" | cut -f2- -d= | tr -d \" | tr -d " ")
echo "debian_name=$DEBIAN_NAME" >> ${{ env.GITHUB_OUTPUT }}
mv target/debian/${{ DEBIAN_NAME }}_${{ DEBIAN_REF }}${{ DEBIAN_REV }}_amd64.deb dist/${{ DEBIAN_NAME }}_${{ DEBIAN_REF }}${{ DEBIAN_REV }}_amd64.deb mv target/debian/${{ DEBIAN_NAME }}_${{ DEBIAN_REF }}${{ DEBIAN_REV }}_amd64.deb dist/${{ DEBIAN_NAME }}_${{ DEBIAN_REF }}${{ DEBIAN_REV }}_amd64.deb
- -
name: Uploading Build Artifact name: Uploading Build Artifact
@ -62,4 +71,16 @@ jobs:
with: with:
name: release_blobs name: release_blobs
path: dist path: dist
if-no-files-found: error if-no-files-found: error
test-env:
needs: build
if: success()
runs-on: docker
steps:
-
name: Test Debian Variables
run: |
test ${{ needs.build.outputs.debian_name }} = $(echo ${{ github.ref_name }} | tr - \~)
test ${{ needs.build.outputs.debian_ref }} = $(cat Cargo.toml | grep -E "(^|\|)revision =" | cut -f2- -d= | tr -d \" | tr -d " ")
test ${{ needs.build.outputs.debian_rev }} = $(cat Cargo.toml | grep -E "(^|\|)name =" | cut -f2- -d= | tr -d \" | tr -d " ")