Skip to content

Release

Release #74

Workflow file for this run

# Code generated by craft; DO NOT EDIT.
name: Release
run-name: Release
on:
workflow_dispatch:
inputs:
mode:
description: Whether to only make a dry_run or to make the release completely
type: choice
default: dry_run
options:
- dry_run
- release
push:
branches:
- main
- master
- v[0-9]+.x
- v[0-9]+.[0-9]+.x
jobs:
version:
name: Version
runs-on: ubuntu-latest
if: ${{ github.ref_protected }} # skip all jobs since they depend on version job
environment: release
permissions:
contents: write
issues: write
pull-requests: write
outputs:
mode: ${{ steps.mode.outputs.mode }}
release: ${{ steps.version.outputs.release }}
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
- id: version
uses: ./.github/actions/version
with:
mode: dry_run # compute only the version to build
token: ${{ secrets.GITHUB_TOKEN }}
- id: mode
run: |
if [ "$GITHUB_EVENT_NAME" = "push" ]; then
echo "mode=release" >> $GITHUB_OUTPUT
exit 0
fi
echo "mode=${INPUT_MODE}" >> $GITHUB_OUTPUT
env:
INPUT_MODE: ${{ inputs.mode }}
build:
name: Build
needs: version
uses: ./.github/workflows/build.yml
with:
version: ${{ needs.version.outputs.version }}
docker:
name: Docker
needs: version
uses: ./.github/workflows/docker.yml
permissions:
contents: write
issues: write
pull-requests: write
security-events: write
with:
version: ${{ needs.version.outputs.version }}
release: ${{ needs.version.outputs.release == 'true' }}
secrets: inherit
release:
name: Release
runs-on: ubuntu-latest
environment: release
permissions:
contents: write
issues: write
pull-requests: write
needs:
- version
- build
- docker
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/version
with:
download_dist: true
mode: ${{ needs.version.outputs.mode }}
token: ${{ secrets.GITHUB_TOKEN }}