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

improvement(workflows): Added a docker-hub version release by Tag #374

Closed

Conversation

yarongilor
Copy link

Once a tag is push, this new gihub action
aims to build Gemini and its docker.
Then login and push to dockerhub.

	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 }}
Copy link
Author

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?

@yarongilor yarongilor requested review from fruch and dkropachev June 25, 2023 18:16
Comment on lines +21 to +26
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
Copy link
Collaborator

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:

Suggested change
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

Comment on lines +50 to +59
- 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run goreleaser instead:

Suggested change
- 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.

Comment on lines +15 to +19
- name: Checkout
uses: actions/checkout@v3
- name: Pull tags and refs
run: git fetch --prune --unshallow
- name: Check if version is updated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 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
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: Check if version is updated
- name: Check if cmd/gemini/Version is updated

@fruch
Copy link
Collaborator

fruch commented Sep 17, 2024

replaced with #427

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants