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

Support releasing tags #15

Merged
merged 1 commit into from
Aug 21, 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
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ on:
workflow_run:
workflows: [ Test ]
branches: [ main ]
types:
tags: [ '*' ]
types:
- completed

jobs:
Expand All @@ -24,3 +25,5 @@ jobs:

- name: Release
run: ./scripts/release.sh
env:
VERSION: ${{ github.ref_name == 'main' && 'latest' || github.ref_name }}
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Test
on:
push: { branches: [ main ] }
push:
branches: [ main ]
tags: [ '*' ]
pull_request:

jobs:
Expand Down
8 changes: 5 additions & 3 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
# Safeties on: https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -euo pipefail

DEFAULT_TAG=naushadh/hive-metastore:latest
TAG=${TAG:-$DEFAULT_TAG}
if [ -z ${VERSION+x} ]; then
echo "Expected \$VERSION to be defined!";
exit 1
fi

docker buildx ls | grep multiarch || docker buildx create --name multiarch --use

docker buildx build --push \
--platform linux/arm64,linux/amd64 \
--tag "$TAG" \
--tag "naushadh/hive-metastore:${VERSION}" \
.