chore: rename action to allow release to marketplace #2
Workflow file for this run
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: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write # Need write access to create releases | |
| jobs: | |
| create-release: | |
| name: Create GitHub Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| body: | | |
| ## 🚀 Usage | |
| ```yaml | |
| - uses: tkstang/github-typescript@${{ github.ref_name }} | |
| with: | |
| ts-file: .github/scripts/my-script.ts | |
| node-version: "22" | |
| args: | | |
| { | |
| "key": "value" | |
| } | |
| ``` | |
| ## 📋 Full Changelog | |
| See below for auto-generated release notes. | |
| update-major-tag: | |
| name: Update Major Version Tag | |
| runs-on: ubuntu-latest | |
| needs: create-release | |
| if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Update major version tag | |
| run: | | |
| # Extract major version from tag (e.g., v1.2.3 -> v1) | |
| TAG_NAME="${GITHUB_REF#refs/tags/}" | |
| MAJOR_VERSION=$(echo "$TAG_NAME" | cut -d. -f1) | |
| echo "Updating $MAJOR_VERSION to point to $TAG_NAME" | |
| # Create or update the major version tag | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| # Delete existing major tag if it exists | |
| git tag -d "$MAJOR_VERSION" 2>/dev/null || true | |
| git push origin ":refs/tags/$MAJOR_VERSION" 2>/dev/null || true | |
| # Create new major tag pointing to current commit | |
| git tag "$MAJOR_VERSION" | |
| git push origin "$MAJOR_VERSION" |