diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ba233c2..35afd55 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,10 @@ on: GPG_PASSPHRASE: description: 'GPG passphrase' required: false + outputs: + version: + description: 'Version of the built package' + value: ${{ jobs.build-deb.outputs.version }} jobs: build-deb: @@ -30,6 +34,8 @@ jobs: # TODO: Change ubuntu-20.04 for the ARM public runner runs-on: ${{ inputs.architecture == 'amd64' && 'ubuntu-latest' || 'ubuntu-20.04' }} environment: ${{ inputs.environment }} + outputs: + version: ${{ steps.is-signed-build.outputs.built-version }} permissions: contents: read strategy: @@ -63,6 +69,7 @@ jobs: id: is-signed-build run: | echo "HAS_SECRETS=$(if [ -n "$GPG_PRIVATE_KEY" ] && [ -n "$GPG_PASSPHRASE" ]; then echo 'true'; else echo 'false'; fi)" >> $GITHUB_OUTPUT + echo "built-version=$(poetry version --short)" >> $GITHUB_OUTPUT env: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} @@ -112,8 +119,6 @@ jobs: run: | make debian debian-full make wheel - env: - PANTOS_SERVICE_NODE_VERSION: ${{ inputs.version }} shell: sh - name: Sign package diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f83a999..6d73258 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -18,5 +18,6 @@ jobs: needs: [build] secrets: 'inherit' with: - tag: development + tag: ${{ needs.build.outputs.version }}-development architecture: amd64 + environment: main diff --git a/.github/workflows/publish-docker.yaml b/.github/workflows/publish-docker.yaml index 1a2c9c8..7dcdb2a 100644 --- a/.github/workflows/publish-docker.yaml +++ b/.github/workflows/publish-docker.yaml @@ -11,6 +11,10 @@ on: required: false type: string default: "amd64" + environment: + description: 'Environment where the secrets are stored' + required: true + type: string secrets: DOCKERHUB_USERNAME: description: 'Docker Hub username' @@ -24,7 +28,7 @@ jobs: publish-docker: name: Publish docker image for ${{ inputs.tag }}/${{ inputs.architecture }} environment: - name: dockerhub + name: ${{ inputs.environment }} url: ${{ steps.set-output-url.outputs.deployment_dockerhub_url }} runs-on: ${{ inputs.architecture == 'amd64' && 'ubuntu-latest' || 'ubuntu-20.04' }} permissions: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 114aaf6..bee9cc8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -58,6 +58,7 @@ jobs: with: tag: ${{ github.event.release.tag_name }}${{ needs.define-environment.outputs.deployment_environment }} architecture: amd64 + environment: dockerhub build: name: Build and attach .deb and .whl package