fix: pass input for version output format #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | ||
| on: | ||
| workflow_call: | ||
| outputs: | ||
| version: | ||
| description: 'The version of the release' | ||
| value: ${{ jobs.release.outputs.version }} | ||
| secrets: | ||
| registry-password: | ||
| description: 'The container registry password' | ||
| required: false | ||
| checkout-token: | ||
| description: 'Checkout token with repo permissions' | ||
| required: false | ||
| inputs: | ||
| git-user-name: | ||
| description: 'The git user name' | ||
| required: false | ||
| type: string | ||
| default: 'github-actions[bot]' | ||
| git-user-email: | ||
| description: 'The git user email' | ||
| required: false | ||
| type: string | ||
| default: '41898282+github-actions[bot]@users.noreply.github.com' | ||
| git-add-files: | ||
| description: 'The files to add to git' | ||
| required: false | ||
| type: string | ||
| version-previous: | ||
| description: 'The strategy to detect the previous version: auto, from-tag, from-file or manual' | ||
| required: false | ||
| default: 'auto' | ||
| type: string | ||
| version-next: | ||
| description: 'The strategy to calculate the next version: auto, semantic, from-file, increment or manual' | ||
| required: false | ||
| default: 'auto' | ||
| type: string | ||
| version-output-format: | ||
| description: 'The output format of the next version' | ||
| required: false | ||
| default: '{{.Major}}.{{.Minor}}.{{.Patch}}' | ||
| type: string | ||
| version-file: | ||
| description: 'Set version in file named as input' | ||
| required: false | ||
| type: string | ||
| version-makefile: | ||
| description: 'Set version in makefile named as input' | ||
| required: false | ||
| type: string | ||
| version-justfile: | ||
| description: 'Set version in justfile named as input' | ||
| required: false | ||
| type: string | ||
| version-package: | ||
| description: 'Set version in package json named as input' | ||
| required: false | ||
| type: string | ||
| version-package-lock: | ||
| description: 'Set version in package lock named as input' | ||
| required: false | ||
| type: string | ||
| version-script: | ||
| description: 'Set version in script named as input' | ||
| required: false | ||
| type: string | ||
| version-chart: | ||
| description: 'Set version in chart named as input' | ||
| required: false | ||
| type: string | ||
| build-container-image: | ||
| description: 'Build the container image' | ||
| required: false | ||
| default: true | ||
| type: boolean | ||
| bake-file: | ||
| description: 'The bake file' | ||
| required: false | ||
| default: 'docker-bake.hcl' | ||
| type: string | ||
| bake-push: | ||
| description: 'Push the image' | ||
| required: false | ||
| default: true | ||
| type: boolean | ||
| bake-targets: | ||
| description: 'The bake target' | ||
| required: false | ||
| default: 'build' | ||
| type: string | ||
| bake-set: | ||
| description: 'The bake set' | ||
| required: false | ||
| type: string | ||
| default: | | ||
| *.cache-to=type=gha,ignore-error=true,mode=max | ||
| *.cache-from=type=gha | ||
| bake-extra-files: | ||
| description: 'Extra files to include in buildx bake' | ||
| required: false | ||
| type: string | ||
| meta-tags: | ||
| description: 'The tags to add to the image' | ||
| required: false | ||
| type: string | ||
| meta-labels: | ||
| description: 'The labels to add to the image' | ||
| required: false | ||
| type: string | ||
| registry: | ||
| description: 'The container registry' | ||
| required: false | ||
| default: 'ghcr.io' | ||
| type: string | ||
| registry-image: | ||
| description: 'Container registry + image prefix (e.g. ghcr.io/org/repo)' | ||
| required: false | ||
| default: ghcr.io/${{ github.repository }} | ||
| type: string | ||
| registry-username: | ||
| description: 'The container registry username' | ||
| required: false | ||
| default: ${{ github.actor }} | ||
| type: string | ||
| prepare-command: | ||
| description: 'The command to run for preparing the build' | ||
| required: false | ||
| type: string | ||
| lint-command: | ||
| description: 'The command to run for linting' | ||
| required: false | ||
| type: string | ||
| checks-command: | ||
| description: 'The command to run for checks' | ||
| required: false | ||
| type: string | ||
| build-command: | ||
| description: 'The command to run for building' | ||
| required: false | ||
| type: string | ||
| test-command: | ||
| description: 'The command to run for testing' | ||
| required: false | ||
| type: string | ||
| release-command: | ||
| description: 'The command to run for releasing' | ||
| required: false | ||
| type: string | ||
| promote-command: | ||
| description: 'The command to run for promoting the release' | ||
| required: false | ||
| type: string | ||
| final-command: | ||
| description: 'The command to run at the end of the workflow' | ||
| required: false | ||
| type: string | ||
| push-git: | ||
| description: 'Push git changes' | ||
| required: false | ||
| default: true | ||
| type: boolean | ||
| just-install: | ||
| description: 'Install just' | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| just-version: | ||
| description: 'The version of just to install' | ||
| required: false | ||
| default: '1.35.0' | ||
| type: string | ||
| runs-on: | ||
| description: 'The runner to use' | ||
| required: false | ||
| default: 'ubuntu-24.04' | ||
| type: string | ||
| free-disk-space: | ||
| description: 'Free disk space before build' | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| fetch-depth: | ||
| description: 'Number of commits to fetch. 0 indicates all history for all branches and tags' | ||
| required: false | ||
| type: number | ||
| default: 0 | ||
| fetch-tags: | ||
| description: 'Whether to fetch tags' | ||
| required: false | ||
| type: boolean | ||
| default: true | ||
| submodules: | ||
| description: 'Whether to checkout submodules: true, false, or recursive' | ||
| required: false | ||
| type: boolean | ||
| default: true | ||
| permissions: | ||
| contents: write | ||
| packages: write | ||
| jobs: | ||
| release: | ||
| name: Release | ||
| runs-on: ${{ inputs.runs-on }} | ||
| outputs: | ||
| version: ${{ steps.release_version.outputs.version }} | ||
| commit-sha: ${{ steps.determine_sha.outputs.sha }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: ${{ inputs.fetch-depth }} | ||
| fetch-tags: ${{ inputs.fetch-tags }} | ||
| submodules: ${{ inputs.submodules }} | ||
| token: ${{ secrets.checkout-token || secrets.GITHUB_TOKEN }} | ||
| - name: Determine commit SHA | ||
| id: determine_sha | ||
| shell: bash | ||
| run: | | ||
| SHA=$(git rev-parse HEAD) | ||
| echo "sha=${SHA}" >> "$GITHUB_OUTPUT" | ||
| echo "Using commit SHA: ${SHA}" | ||
| - name: Set up qemu | ||
| uses: docker/setup-qemu-action@v3 | ||
| - name: Free Disk Space (Ubuntu) | ||
| uses: jlumbroso/free-disk-space@v1.3.1 | ||
| if: ${{ inputs.free-disk-space == true }} | ||
| with: | ||
| tool-cache: true | ||
| - name: Next release version | ||
| id: release_version | ||
| uses: getdevopspro/github-actions/release-version@v2.0.0 | ||
| with: | ||
| previous-version: ${{ inputs.version-previous }} | ||
| next-version: ${{ inputs.version-next }} | ||
| output-format: ${{ input.version-output-format }} | ||
| - name: Set version in file | ||
| uses: getdevopspro/github-actions/version-file@v2.0.0 | ||
| with: | ||
| version: ${{ steps.release_version.outputs.version }} | ||
| version-makefile: ${{ inputs.version-makefile }} | ||
| version-justfile: ${{ inputs.version-justfile }} | ||
| version-package: ${{ inputs.version-package }} | ||
| version-package-lock: ${{ inputs.version-package-lock }} | ||
| version-script: ${{ inputs.version-script }} | ||
| version-chart: ${{ inputs.version-chart }} | ||
| - name: Install just | ||
| if: inputs.just-install | ||
| uses: extractions/setup-just@v2 | ||
| with: | ||
| just-version: ${{ inputs.just-version }} | ||
| - name: Run prepare command | ||
| if: inputs.prepare-command != '' | ||
| id: prepare_command | ||
| shell: bash | ||
| run: ${{ inputs.prepare-command }} | ||
| - name: Run lint command | ||
| if: inputs.lint-command != '' | ||
| id: lint_command | ||
| shell: bash | ||
| run: ${{ inputs.lint-command }} | ||
| - name: Run checks command | ||
| if: inputs.checks-command != '' | ||
| id: checks_command | ||
| shell: bash | ||
| run: ${{ inputs.checks-command }} | ||
| - name: Run build command | ||
| if: inputs.build-command != '' | ||
| id: build_command | ||
| shell: bash | ||
| run: ${{ inputs.build-command }} | ||
| - name: Build container image | ||
| uses: getdevopspro/github-actions/buildx-bake@v2.0.0 | ||
| if: inputs.build-container-image | ||
| id: build_container_image | ||
| with: | ||
| bake-file: ${{ inputs.bake-file }} | ||
| bake-push: ${{ inputs.bake-push }} | ||
| bake-targets: ${{ inputs.bake-targets }} | ||
| bake-set: ${{ inputs.bake-set }} | ||
| bake-extra-files: ${{ inputs.bake-extra-files }} | ||
| registry-image: ${{ inputs.registry-image }} | ||
| registry: ${{ inputs.registry }} | ||
| registry-username: ${{ inputs.registry-username }} | ||
| registry-password: ${{ secrets.registry-password || secrets.GITHUB_TOKEN }} | ||
| meta-labels: | ||
| manifest:org.opencontainers.image.version=${{ steps.release_version.outputs.version }} | ||
| ${{ inputs.meta-labels }} | ||
| meta-tags: | | ||
| type=raw,value=latest,enable={{is_default_branch}} | ||
| type=semver,pattern={{version}},value=${{ steps.release_version.outputs.version }},enable={{is_default_branch}} | ||
| type=semver,pattern={{major}}.{{minor}},value=${{ steps.release_version.outputs.version }},enable={{is_default_branch}} | ||
| type=semver,pattern={{major}},value=${{ steps.release_version.outputs.version }},enable={{is_default_branch}} | ||
| type=edge,branch=$repo.default_branch,event=push | ||
| type=sha,event=push | ||
| type=ref,event=branch | ||
| type=ref,event=pr | ||
| type=raw,${{ steps.determine_sha.outputs.sha }} | ||
| ${{ inputs.meta-tags }} | ||
| - name: Run test command | ||
| if: inputs.test-command != '' | ||
| id: test_command | ||
| shell: bash | ||
| run: ${{ inputs.test-command }} | ||
| - name: Run release command | ||
| if: inputs.release-command != '' | ||
| id: release_command | ||
| shell: bash | ||
| run: ${{ inputs.release-command }} | ||
| - name: Push git version | ||
| uses: getdevopspro/github-actions/release-git-push@v2.0.0 | ||
| if: inputs.push-git | ||
| id: git_push | ||
| with: | ||
| version: ${{ steps.release_version.outputs.version }} | ||
| git-user-name: ${{ inputs.git-user-name }} | ||
| git-user-email: ${{ inputs.git-user-email }} | ||
| git-add-files: ${{ inputs.git-add-files }} | ||
| - name: Run promote command | ||
| if: inputs.promote-command != '' | ||
| id: promote_command | ||
| shell: bash | ||
| run: ${{ inputs.promote-command }} | ||
| - name: Run final command | ||
| if: inputs.final-command != '' | ||
| id: final_command | ||
| shell: bash | ||
| run: ${{ inputs.final-command }} | ||