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

Tag commits during release #9

Merged
merged 1 commit into from
Jun 30, 2024
Merged
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
18 changes: 15 additions & 3 deletions .github/workflows/release_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
id-token: write
packages: write
steps:
Expand All @@ -33,6 +33,9 @@

- uses: actions/checkout@v4

- name: Fetch tags
run: git fetch --prune --unshallow --tags

- name: Setup Python
id: setup-python
uses: actions/setup-python@v5
Expand All @@ -57,20 +60,29 @@
run: poetry self add poetry-bumpversion

- name: Bump version
run: poetry version ${{ inputs.version_bump_type }}
run: |
poetry version $(git tag --sort version:refname | tail -n 1)
poetry version ${{ inputs.version_bump_type }}

- name: Save version to env var
id: version
run: echo "version=$(poetry version --short)" >> $GITHUB_OUTPUT

- name: Tag commit and push
run: |
git config --globa user.email "[email protected]"
git config --global user.name "github-actions[bot]"
git tag -a ${{ steps.version.outputs.version }} -m "${{ steps.version.outputs.version }}"
git push origin "${{ steps.version.outputs.version }}"

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ github.sha }}
type=raw,value=${{ steps.version.outputs.version }}
type=raw,value=${{ github.sha }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down