Skip to content

Release with versioning #65

Release with versioning

Release with versioning #65

Workflow file for this run

name: Release with versioning
on:
# push:
# branches:
# - main
workflow_dispatch:
inputs:
version:
description: A version to release
required: true
permissions:
contents: write
packages: write
jobs:
versioning:
if: ${{ github.event_name != 'workflow_dispatch' }}
name: Versioning
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.versioning.outputs.new_tag }}
changelog: ${{ steps.versioning.outputs.changelog }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Bump version and tag
id: versioning
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: false
build-and-push:
if: ${{ needs.versioning.outputs.tag }}
name: Build and publish image
needs:
- versioning
uses: ./.github/workflows/publish-image.yaml
with:
name: ${{ github.repository }}
tag: ${{ needs.versioning.outputs.tag }}
ref: ${{ needs.versioning.outputs.tag }}
release:
name: Release
runs-on: ubuntu-latest
needs:
- build-and-push
steps:
- name: Create release
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.versioning.outputs.tag }}
name: ${{ needs.versioning.outputs.tag }}
body: ${{ needs.versioning.outputs.changelog }}
build-and-push-from-dispatch:
if: ${{ github.event_name == 'workflow_dispatch' }}
name: Build and publish image
uses: ./.github/workflows/publish-image.yaml
with:
name: ${{ github.repository }}
tag: ${{ github.event.inputs.version }}
ref: ${{ github.event.inputs.version }}