-
Notifications
You must be signed in to change notification settings - Fork 18
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
improvement(workflows): Added a docker-hub version release by Tag #374
improvement(workflows): Added a docker-hub version release by Tag #374
Conversation
yarongilor
commented
Jun 25, 2023
Once a tag is push, this new gihub-action aims to build Gemini and its docker. Then login and push to dockerhub.
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yaronkaikov , can you please configure corresponding 2 secrets named DOCKER_HUB_USERNAME and DOCKER_HUB_ACCESS_TOKEN in order to use for uploading artifacts to dockerhub?
export ExpectedVersion=$(git describe --tags --abbrev=0) | ||
export DefinedVersion=$(cat cmd/gemini/Version) | ||
if [ "$ExpectedVersion" != "$DefinedVersion" ]; then | ||
echo "Expect to have '$ExpectedVersion', but got '$DefinedVersion'" | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't have to export it:
export ExpectedVersion=$(git describe --tags --abbrev=0) | |
export DefinedVersion=$(cat cmd/gemini/Version) | |
if [ "$ExpectedVersion" != "$DefinedVersion" ]; then | |
echo "Expect to have '$ExpectedVersion', but got '$DefinedVersion'" | |
exit 1 | |
fi | |
EXPECTED_VERSION=$(git describe --tags --abbrev=0) | |
DEFINED_VERSION=$(cat cmd/gemini/Version) | |
if [ "$EXPECTED_VERSION" != "$DEFINED_VERSION" ]; then | |
echo "Expect to have '$EXPECTED_VERSION', but got '$DEFINED_VERSION'" | |
exit 1 | |
fi |
- name: Build and push master | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
file: ./cmd/gemini/Dockerfile | ||
push: true | ||
tags: | | ||
scylladb/gemini:latest | ||
# TODO: add a new version tag as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run goreleaser
instead:
- name: Build and push master | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
file: ./cmd/gemini/Dockerfile | |
push: true | |
tags: | | |
scylladb/gemini:latest | |
# TODO: add a new version tag as well. | |
- name: Releasing gemini | |
run: cd cmd/gemini; goreleaser | |
# TODO: add a new version tag as well. |
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Pull tags and refs | ||
run: git fetch --prune --unshallow | ||
- name: Check if version is updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Pull tags and refs | |
run: git fetch --prune --unshallow | |
- name: Check if version is updated | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Pull tags and refs | |
run: git fetch --prune --unshallow | |
- name: Check if version is updated |
echo "Expect to have '$ExpectedVersion', but got '$DefinedVersion'" | ||
exit 1 | ||
fi | ||
- name: Setup Go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need a step to verify if CHANGELOG.md
is updated:
- name: Check if CHANGELOG.md has been updated
run: |
EXPECTED_VERSION=$(git describe --tags --abbrev=0)
if ! grep '## \[' ./CHANGELOG.md | head -n 1 | grep "${EXPECTED_VERSION//*v/}"; then
echo "Please update CHANGELOG.md"
exit 1
fi
uses: actions/checkout@v3 | ||
- name: Pull tags and refs | ||
run: git fetch --prune --unshallow | ||
- name: Check if version is updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: Check if version is updated | |
- name: Check if cmd/gemini/Version is updated |
replaced with #427 |