Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions .github/workflows/op_rbuilder_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/}"
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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, '-') }}
Expand Down
Loading