Skip to content

chore(ci): fix release on version change workflow (#208) #2

chore(ci): fix release on version change workflow (#208)

chore(ci): fix release on version change workflow (#208) #2

name: Trigger release based on VERSION file change
on:
push:
paths:
- VERSION
branches:
- main
jobs:
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
latest: ${{ steps.version.outputs.version == 'latest' }}
steps:
- uses: actions/checkout@v4
- id: version
run: |
echo "version=$(head -1 VERSION)" >> "$GITHUB_OUTPUT"
echo "latest=$(tail -1 VERSION)" >> "$GITHUB_OUTPUT"
- name: Validate semver
uses: booxmedialtd/[email protected]
with:
input_string: ${{ steps.version.outputs.version }}
version_extractor_regex: 'v(.*)$'
trigger_release:
needs:
- version
uses: ./.github/workflows/release.yaml
with:
tag: ${{ needs.version.outputs.version }}
latest: ${{ needs.version.outputs.latest == 'latest' }}