From 2567ff111b1bc8d5cac467ee7fa6596e21bdbe72 Mon Sep 17 00:00:00 2001 From: saul-data Date: Mon, 9 Oct 2023 22:15:11 +0100 Subject: [PATCH] embed version into binary --- .github/workflows/main-runtests.yml | 1 + .github/workflows/release-docker-mainapp.yml | 12 ++++++------ .../release-docker-python-worker-ubuntu.yml | 14 +++++++------- .github/workflows/release-docker-python-worker.yml | 14 +++++++------- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/main-runtests.yml b/.github/workflows/main-runtests.yml index 04680bbf5..f1f4e6fee 100644 --- a/.github/workflows/main-runtests.yml +++ b/.github/workflows/main-runtests.yml @@ -49,6 +49,7 @@ jobs: # Get values for cache paths to be used in later steps - id: go-cache-paths + name: Github Actions Environment Variables run: | echo "go-build=$(go env GOCACHE)" >> "$GITHUB_ENV" echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_ENV" diff --git a/.github/workflows/release-docker-mainapp.yml b/.github/workflows/release-docker-mainapp.yml index 569751105..be602c859 100644 --- a/.github/workflows/release-docker-mainapp.yml +++ b/.github/workflows/release-docker-mainapp.yml @@ -22,10 +22,10 @@ jobs: run: echo "DP_VERSION=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV" # - name: Release check out ${{ steps.get_version.outputs.VERSION }} - - name: Release check out $DP_VERSION + - name: Release check out ${{ env.DP_VERSION }} uses: actions/checkout@v3 with: - ref: $DP_VERSION + ref: ${{ env.DP_VERSION }} # ref: ${{ steps.get_version.outputs.VERSION }} # Login against a Docker registry except on PR @@ -43,10 +43,10 @@ jobs: # with: # cosign-release: 'v1.9.0' - - name: Tag reference ${{ github.ref }} - version=$DP_VERSION + - name: Tag reference ${{ github.ref }} - version=${{ env.DP_VERSION }} run: | - echo release: $DP_VERSION - export dpversion=$DP_VERSION + echo release: ${{ env.DP_VERSION }} + export dpversion=${{ env.DP_VERSION }} echo docker version: $dpversion @@ -73,7 +73,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | - DATAPLANE_VERSION=$DP_VERSION + DATAPLANE_VERSION=${{ env.DP_VERSION }} # Sign the resulting Docker image digest except on PRs. # This will only write to the public Rekor transparency log when the Docker diff --git a/.github/workflows/release-docker-python-worker-ubuntu.yml b/.github/workflows/release-docker-python-worker-ubuntu.yml index 9ff05a683..6171ae5d4 100644 --- a/.github/workflows/release-docker-python-worker-ubuntu.yml +++ b/.github/workflows/release-docker-python-worker-ubuntu.yml @@ -18,12 +18,12 @@ jobs: - name: Get the version id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + run: echo "DP_VERSION=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV" - - name: Release check out ${{ steps.get_version.outputs.VERSION }} + - name: Release check out ${{ env.DP_VERSION }} uses: actions/checkout@v3 with: - ref: ${{ steps.get_version.outputs.VERSION }} + ref: ${{ env.DP_VERSION }} # Login against a Docker registry except on PR # https://github.com/docker/login-action @@ -40,10 +40,10 @@ jobs: # with: # cosign-release: 'v1.9.0' - - name: Tag reference ${{ github.ref }} - version=${{ steps.get_version.outputs.VERSION }} + - name: Tag reference ${{ github.ref }} - version=${{ env.DP_VERSION }} run: | - echo release: ${{ steps.get_version.outputs.VERSION }} - export dpversion=${{ steps.get_version.outputs.VERSION }} + echo release: ${{ env.DP_VERSION }} + export dpversion=${{ env.DP_VERSION }} echo docker version: $dpversion @@ -70,7 +70,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | - DATAPLANE_VERSION=${{ steps.get_version.outputs.VERSION }} + DATAPLANE_VERSION=${{ env.DP_VERSION }} # Sign the resulting Docker image digest except on PRs. # This will only write to the public Rekor transparency log when the Docker diff --git a/.github/workflows/release-docker-python-worker.yml b/.github/workflows/release-docker-python-worker.yml index e16f5322c..7ab7bd2c5 100644 --- a/.github/workflows/release-docker-python-worker.yml +++ b/.github/workflows/release-docker-python-worker.yml @@ -18,12 +18,12 @@ jobs: - name: Get the version id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + run: echo "DP_VERSION=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV" - - name: Release check out ${{ steps.get_version.outputs.VERSION }} + - name: Release check out ${{ env.DP_VERSION }} uses: actions/checkout@v3 with: - ref: ${{ steps.get_version.outputs.VERSION }} + ref: ${{ env.DP_VERSION }} # Login against a Docker registry except on PR # https://github.com/docker/login-action @@ -40,10 +40,10 @@ jobs: # with: # cosign-release: 'v1.9.0' - - name: Tag reference ${{ github.ref }} - version=${{ steps.get_version.outputs.VERSION }} + - name: Tag reference ${{ github.ref }} - version=${{ env.DP_VERSION }} run: | - echo release: ${{ steps.get_version.outputs.VERSION }} - export dpversion=${{ steps.get_version.outputs.VERSION }} + echo release: ${{ env.DP_VERSION }} + export dpversion=${{ env.DP_VERSION }} echo docker version: $dpversion @@ -70,7 +70,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | - DATAPLANE_VERSION=${{ steps.get_version.outputs.VERSION }} + DATAPLANE_VERSION=${{ env.DP_VERSION }} # Sign the resulting Docker image digest except on PRs. # This will only write to the public Rekor transparency log when the Docker