Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): enable bridge withdrawer building with tag #1374

Merged
merged 3 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
package-name: 'conductor'
tag: ${{ inputs.tag }}

composer:
uses: './.github/workflows/reusable-build.yml'
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
with:
depot-project-id: mhgvgvsjnx
package-name: composer
target-binary: astria-composer
binary-name: composer
tag: ${{ inputs.tag }}
secrets: inherit

Expand All @@ -64,7 +64,7 @@ jobs:
with:
depot-project-id: zrh9t1d84s
package-name: conductor
target-binary: astria-conductor
binary-name: conductor
tag: ${{ inputs.tag }}
secrets: inherit

Expand All @@ -79,7 +79,7 @@ jobs:
with:
depot-project-id: brzhxfbv9b
package-name: sequencer
target-binary: astria-sequencer
binary-name: sequencer
tag: ${{ inputs.tag }}
secrets: inherit

Expand All @@ -94,7 +94,7 @@ jobs:
with:
depot-project-id: 86q4kz4wfs
package-name: sequencer-relayer
target-binary: astria-sequencer-relayer
binary-name: sequencer-relayer
tag: ${{ inputs.tag }}
secrets: inherit

Expand All @@ -109,7 +109,7 @@ jobs:
with:
depot-project-id: dl81f3fc6x
package-name: evm-bridge-withdrawer
target-binary: astria-bridge-withdrawer
binary-name: bridge-withdrawer
tag: ${{ inputs.tag }}
secrets: inherit

Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/reusable-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ on:
package-name:
required: true
type: string
target-binary:
binary-name:
required: true
type: string
binary-prefix:
type: string
default: astria
tag:
required: false
type: string
Expand All @@ -23,15 +26,15 @@ on:
env:
REGISTRY: ghcr.io
FULL_REF: ${{ inputs.tag && format('refs/tags/{0}', inputs.tag) || github.ref }}

FULL_BINARY_NAME: ${{ inputs.binary-prefix }}-${{ inputs.binary-name }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
if: startsWith(inputs.tag, inputs.package-name) || !inputs.tag && (startsWith(github.ref, format('refs/tags/{0}-v', inputs.package-name)) || github.ref == 'refs/heads/main' || github.event_name == 'pull_request' || github.event_name == 'merge_group')
if: startsWith(inputs.tag, inputs.binary-name) || !inputs.tag && (startsWith(github.ref, format('refs/tags/{0}-v', inputs.binary-name)) || github.ref == 'refs/heads/main' || github.event_name == 'pull_request' || github.event_name == 'merge_group')
steps:
# Checking out the repo
- uses: actions/checkout@v4
Expand Down Expand Up @@ -59,7 +62,7 @@ jobs:
images: ${{ format('ghcr.io/astriaorg/{0}', inputs.package-name) }}
tags: |
type=ref,event=pr
type=match,pattern=refs/tags/${{ inputs.package-name }}-v(.*),group=1,enable=${{ startsWith(env.FULL_REF, 'refs/tags/') }},value=${{ env.FULL_REF }}
type=match,pattern=refs/tags/${{ inputs.binary-name }}-v(.*),group=1,enable=${{ startsWith(env.FULL_REF, 'refs/tags/') }},value=${{ env.FULL_REF }}
type=sha
# set latest tag for `main` branch
type=raw,value=latest,enable=${{ env.FULL_REF == format('refs/heads/{0}', 'main') }}
Expand All @@ -72,7 +75,7 @@ jobs:
context: .
file: containerfiles/Dockerfile
build-args: |
TARGETBINARY=${{ inputs.target-binary }}
TARGETBINARY=${{ env.FULL_BINARY_NAME }}
platforms: "linux/amd64,linux/arm64"
push: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'astriaorg/astria' }}
tags: ${{ steps.metadata.outputs.tags }}
Expand Down
Loading