Skip to content

chore(main): release 0.2.0 (#66) #26

chore(main): release 0.2.0 (#66)

chore(main): release 0.2.0 (#66) #26

on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
packages: write # required for gchr.io
name: release-please
jobs:
release:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
pr: ${{ steps.release.outputs.pr }}
pr_head_ref: ${{ steps.release.outputs.pr_head_ref }}
steps:
- name: Create GitHub release
uses: GoogleCloudPlatform/release-please-action@v4
id: release
with:
# Use the built-in GITHUB_TOKEN if permissions allow,
# otherwise ensure BOT_TOKEN has 'workflows' scope.
token: ${{ secrets.BOT_TOKEN }}
- name: Checkout release PR branch
if: ${{ steps.release.outputs.pr }}
uses: actions/checkout@v4
with:
ref: ${{ steps.release.outputs.pr_head_ref }}
token: ${{ secrets.BOT_TOKEN }}
- name: Setup Pixi
if: ${{ steps.release.outputs.pr }}
uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: latest
run-install: false
- name: Update lockfile and commit
if: ${{ steps.release.outputs.pr }}
run: |
# pixi install resolves dependencies and updates pixi.lock.
# We need the full install (not --no-install) because our project
# uses an editable PyPI dependency ({ path = ".", editable = true })
# which requires a build dispatch to resolve, and build dispatch
# requires an installed conda environment.
pixi install
if git diff --quiet pixi.lock 2>/dev/null; then
echo "No lockfile changes needed"
else
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add pixi.lock
git commit -m "chore: update pixi.lock for version bump"
git push
fi
build-publish:
runs-on: ubuntu-latest
needs: release
if: ${{ needs.release.outputs.release_created }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/bihealth/svirlpool
tags: |
type=raw,value=latest
type=raw,value=${{ needs.release.outputs.tag_name }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: utils/docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max