Skip to content

Release a New Version #4

Release a New Version

Release a New Version #4

Workflow file for this run

name: Release
on:
workflow_dispatch:
jobs:
bump-versions:
name: Bump Versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- id: cz
name: Bump Version, Create Tag and Changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.GH_ACCESS_TOKEN }}
changelog_increment_filename: body.md
- name: Create Release
uses: softprops/action-gh-release@v2
with:
body_path: "body.md"
tag_name: ${{ env.REVISION }}
env:
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
- name: Print Version
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
release:
name: Release
runs-on: ubuntu-latest
needs:
- bump-versions
permissions:
id-token: write
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the GitHub Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata for Docker
id: docker-metadata
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/traceloop/hub # GitHub
traceloop/hub # Docker Hub
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.docker-metadata.outputs.tags }}
labels: ${{ steps.docker-metadata.outputs.labels }}
platforms: |
linux/amd64
${{ startsWith(github.ref, 'refs/tags/') && 'linux/arm64' || '' }}