Release Trigger #3
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 Trigger | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| extension_id: | |
| description: 'Extension directory name (e.g., aide, extensify, presetify)' | |
| required: true | |
| type: string | |
| version: | |
| description: 'Version to release (e.g., 1.0.0)' | |
| required: true | |
| type: string | |
| jobs: | |
| tag-and-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Validate inputs | |
| env: | |
| EXTENSION_ID: ${{ github.event.inputs.extension_id }} | |
| VERSION: ${{ github.event.inputs.version }} | |
| run: | | |
| # Strip optional v prefix | |
| VERSION="${VERSION#v}" | |
| # Validate version format | |
| if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| echo "Error: Invalid version format '$VERSION'. Must be X.Y.Z" >&2 | |
| exit 1 | |
| fi | |
| # Validate extension directory exists | |
| if [[ ! -d "$EXTENSION_ID" ]]; then | |
| echo "Error: Extension directory '$EXTENSION_ID' not found" >&2 | |
| exit 1 | |
| fi | |
| # Validate extension.yml exists | |
| if [[ ! -f "$EXTENSION_ID/extension.yml" ]]; then | |
| echo "Error: $EXTENSION_ID/extension.yml not found" >&2 | |
| exit 1 | |
| fi | |
| TAG="${EXTENSION_ID}-v${VERSION}" | |
| # Check if tag already exists | |
| if git rev-parse "$TAG" >/dev/null 2>&1; then | |
| echo "Error: Tag '$TAG' already exists" >&2 | |
| exit 1 | |
| fi | |
| echo "tag=$TAG" >> "$GITHUB_ENV" | |
| echo "Will create tag: $TAG" | |
| - name: Configure Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| - name: Create and push tag | |
| run: | | |
| git tag "$tag" | |
| git push origin "$tag" | |
| echo "Pushed tag $tag — release workflow will handle the rest" |