Skip to content

Commit

Permalink
Update docker build steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Firaenix committed Dec 28, 2024
1 parent 731a423 commit 84584f8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish Docker image
on:
workflow_call:
inputs:
tag:
plan:
required: true
type: string
secrets:
Expand All @@ -16,10 +16,21 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Parse plan
id: plan
run: |
# Extract the tag from plan.outputs.tag
echo "Plan content for debugging:"
echo '${{ inputs.plan }}' | jq .
TAG=$(echo '${{ inputs.plan }}' | jq -r '.tag')
VERSION=$(echo '${{ inputs.plan }}' | jq -r '.releases[0].app_version')
echo "TAG=$TAG" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
ref: ${{ steps.plan.outputs.TAG }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -33,12 +44,6 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract version from tag
id: version
run: echo "VERSION=${TAG#v}" >> $GITHUB_OUTPUT
env:
TAG: ${{ inputs.tag }}

- name: Build and push
uses: docker/build-push-action@v5
with:
Expand All @@ -47,6 +52,6 @@ jobs:
push: true
tags: |
bitping/distributed-metrics:latest
bitping/distributed-metrics:${{ steps.version.outputs.VERSION }}
bitping/distributed-metrics:${{ steps.plan.outputs.VERSION }}
cache-from: type=gha
cache-to: type=gha,mode=max
9 changes: 9 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,3 +358,12 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive

custom-docker-publish:
needs:
- plan
- announce
uses: ./.github/workflows/docker-publish.yml
with:
plan: ${{ needs.plan.outputs.val }}
secrets: inherit
11 changes: 3 additions & 8 deletions dist-workspace.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,16 @@ installers = ["shell", "homebrew"]
# A GitHub repo to push Homebrew formulas to
tap = "BitpingApp/homebrew-tap"
# Target platforms to build apps for (Rust target-triple syntax)
targets = [
"aarch64-apple-darwin",
"aarch64-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-musl",
]
targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl"]
# Path that installers should place binaries in
install-path = "CARGO_HOME"
# Publish jobs to run in CI
publish-jobs = ["homebrew"]
# Whether to install an updater program
install-updater = true
github-build-setup = "../build-setup.yml"
post-announce-jobs = ["../docker-publish.yml"]
# Post-announce jobs to run in CI
post-announce-jobs = ["./docker-publish"]

[dist.github-custom-runners]
# Linux x86_64 builds
Expand Down

0 comments on commit 84584f8

Please sign in to comment.