Skip to content

Commit

Permalink
build: Use cargo version for publishing images from release tags
Browse files Browse the repository at this point in the history
  • Loading branch information
seakayone committed Sep 4, 2024
1 parent 75a6c9e commit c1348f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
name: manifest
runs-on: ubuntu-latest
needs: [publish_amd64, publish_arm64]
if: github.ref == 'refs/heads/main' || (github.event_name == 'create' && startsWith(github.ref, 'refs/tags/dsp-meta-cmd'))
if: github.ref == 'refs/heads/main' || (github.event_name == 'create' && startsWith(github.ref, 'refs/tags'))
outputs:
tag: ${{ steps.output_docker_image_tag.outputs.tag }}
steps:
Expand All @@ -83,7 +83,7 @@ jobs:
name: Trigger deployment to DEV
runs-on: ubuntu-latest
needs: publish_manifest
if: github.ref == 'refs/heads/main' || (github.event_name == 'create' && startsWith(github.ref, 'refs/tags/dsp-meta-cmd'))
if: github.ref == 'refs/heads/main'
steps:
- name: Trigger deployment to DEV
env:
Expand All @@ -98,7 +98,7 @@ jobs:
release-please:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || (github.event_name == 'create' && startsWith(github.ref, 'refs/tags/dsp-meta-cmd'))
if: github.ref == 'refs/heads/main'
steps:
- uses: googleapis/release-please-action@v4
with:
Expand Down
3 changes: 2 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
DOCKER_REPO := "daschswiss/dsp-meta-server"
CARGO_VERSION := `cargo metadata --format-version=1 --no-deps | jq --raw-output '.packages[].version'`
COMMIT_HASH := `git log --pretty=format:'%h' -n 1`
IMAGE_TAG := CARGO_VERSION + "-" + COMMIT_HASH
GIT_TAG := `git describe --tags --exact-match 2>/dev/null || true`
IMAGE_TAG := if GIT_TAG == "" { CARGO_VERSION + "-" + COMMIT_HASH } else { GIT_TAG }
DOCKER_IMAGE := DOCKER_REPO + ":" + IMAGE_TAG

# List all recipies
Expand Down

0 comments on commit c1348f9

Please sign in to comment.