Add RWX as a supported CI provider #49
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: Auto-tag release | |
| on: | |
| pull_request: | |
| types: [closed] | |
| branches: [main] | |
| jobs: | |
| tag: | |
| name: Create release tag | |
| runs-on: ubuntu-latest | |
| if: > | |
| github.event.pull_request.merged == true && | |
| github.event.pull_request.head.repo.full_name == github.repository && | |
| startsWith(github.event.pull_request.head.ref, 'release/') | |
| permissions: | |
| contents: write | |
| actions: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.merge_commit_sha }} | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Extract and validate version | |
| id: version | |
| run: | | |
| BRANCH="${{ github.event.pull_request.head.ref }}" | |
| VERSION="${BRANCH#release/}" | |
| if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then | |
| echo "::error::Invalid version format: $VERSION" | |
| exit 1 | |
| fi | |
| PKG_VERSION=$(node -p "require('./package.json').version") | |
| if [ "$VERSION" != "$PKG_VERSION" ]; then | |
| echo "::error::Branch version ($VERSION) does not match package.json ($PKG_VERSION)" | |
| exit 1 | |
| fi | |
| if git tag -l "v$VERSION" | grep -q .; then | |
| echo "::error::Tag v$VERSION already exists" | |
| exit 1 | |
| fi | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Create and push tag | |
| run: | | |
| git tag "v${{ steps.version.outputs.version }}" | |
| git push origin "v${{ steps.version.outputs.version }}" | |
| - name: Trigger release workflow | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh workflow run release.yml --ref "v${{ steps.version.outputs.version }}" |