diff --git a/.github/workflows/op_rbuilder_release.yaml b/.github/workflows/op_rbuilder_release.yaml index 625ac48db..11f5a131c 100644 --- a/.github/workflows/op_rbuilder_release.yaml +++ b/.github/workflows/op_rbuilder_release.yaml @@ -36,10 +36,10 @@ jobs: name: Extract version runs-on: warp-ubuntu-latest-x64-16x outputs: - VERSION: ${{ steps.extract_version.outputs.VERSION }} + VERSION: ${{ steps.extract-version.outputs.VERSION }} steps: - name: Extract version - id: extract_version + id: extract-version run: | if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then VERSION="${GITHUB_REF#refs/tags/op-rbuilder/}" @@ -62,6 +62,8 @@ jobs: needs: extract-version if: ${{ github.event.inputs.build-binary == 'true' || github.event_name == 'push'}} # when manually triggered or version tagged runs-on: ${{ matrix.configs.runner }} + env: + VERSION: ${{ needs.extract-version.outputs.VERSION }} container: image: ubuntu:22.04 permissions: @@ -111,7 +113,7 @@ jobs: - name: Upload op-rbuilder artifact uses: actions/upload-artifact@v4 with: - name: op-rbuilder-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}${{ matrix.features && '-' }}${{ matrix.features }} + name: op-rbuilder-${{ env.VERSION }}-${{ matrix.configs.target }}${{ matrix.features && '-' }}${{ matrix.features }} path: target/${{ matrix.configs.target }}/release/op-rbuilder draft-release: @@ -120,7 +122,7 @@ jobs: needs: [extract-version, build-binary] runs-on: warp-ubuntu-latest-x64-16x env: - VERSION: op-rbuilder/${{ needs.extract-version.outputs.VERSION }} + VERSION: ${{ needs.extract-version.outputs.VERSION }} permissions: contents: write steps: @@ -154,18 +156,18 @@ jobs: draft: true files: artifacts/* generate_release_notes: true - name: ${{ env.VERSION }} - tag_name: ${{ env.VERSION }} + name: op-rbuilder/${{ env.VERSION }} + tag_name: op-rbuilder/${{ env.VERSION }} - name: Write Github Step Summary run: | echo "---" - echo "### Release Draft: ${{ env.VERSION }}" >> $GITHUB_STEP_SUMMARY + echo "### Release Draft: op-rbuilder/${{ env.VERSION }}" >> $GITHUB_STEP_SUMMARY echo "${{ steps.create-release-draft.outputs.url }}" >> $GITHUB_STEP_SUMMARY - build-docker: + publish-container-image: if: ${{ (github.ref_type == 'tag') || (github.event.inputs.build-docker == 'true') }} - name: Build and publish Docker image + name: Publish container image needs: extract-version runs-on: ${{ matrix.configs.runner }} env: @@ -187,7 +189,7 @@ jobs: - name: set env run: | platform=${{ matrix.configs.platform }} - echo "PLATFORM=${platform//\//-}" >> $GITHUB_ENV + echo "PLATFORM=${platform#*/}" >> $GITHUB_ENV - name: docker qemu uses: docker/setup-qemu-action@v3 @@ -202,13 +204,11 @@ jobs: images: ghcr.io/${{ github.repository }} labels: org.opencontainers.image.source=${{ github.repositoryUrl }} tags: | - type=sha - type=semver,pattern={{version}},value=${{ env.VERSION }} - type=semver,pattern={{major}}.{{minor}},value=${{ env.VERSION }} - type=semver,pattern={{major}},value=${{ env.VERSION }} + type=semver,pattern={{version}},value=${{ env.VERSION }},prefix=v,suffix=-${{ env.PLATFORM }} + type=sha,suffix=-${{ env.PLATFORM }} # Push latest tag for full version only, not for prerelease versions (i.e. not for v1.2.3-rc1) - type=raw,value=latest,enable=${{ !contains(env.VERSION, '-') }} + type=raw,value=latest,enable=${{ !contains(env.VERSION, '-') }},suffix=-${{ env.PLATFORM }} - name: docker login uses: docker/login-action@v3 @@ -248,11 +248,13 @@ jobs: retention-days: 1 publish-container-index: - name: publish container index + name: Publish container index runs-on: warp-ubuntu-latest-x64-16x + env: + VERSION: ${{ needs.extract-version.outputs.VERSION }} needs: - - build-docker - extract-version + - publish-container-image steps: - name: download digests uses: actions/download-artifact@v4 @@ -278,10 +280,8 @@ jobs: images: ghcr.io/${{ github.repository }} labels: org.opencontainers.image.source=${{ github.repositoryUrl }} tags: | + type=semver,pattern={{version}},value=${{ env.VERSION }},prefix=v type=sha - type=semver,pattern={{version}},value=${{ env.VERSION }} - type=semver,pattern={{major}}.{{minor}},value=${{ env.VERSION }} - type=semver,pattern={{major}},value=${{ env.VERSION }} # Push latest tag for full version only, not for prerelease versions (i.e. not for v1.2.3-rc1) type=raw,value=latest,enable=${{ !contains(env.VERSION, '-') }}