build: update the releast-it related config
#2
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: | |
| branches: | |
| - fuddy-duddy | |
| jobs: | |
| check-commit-message: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should-release: ${{ steps.check.outputs.should-release }} | |
| steps: | |
| - name: Check if commit message triggers release | |
| id: check | |
| run: | | |
| COMMIT_MSG="${{ github.event.head_commit.message }}" | |
| if [[ "$COMMIT_MSG" == "release: release to"* ]]; then | |
| echo "should-release=true" >> $GITHUB_OUTPUT | |
| echo "✅ Commit message starts with 'release: release to' - proceeding with release" | |
| else | |
| echo "should-release=false" >> $GITHUB_OUTPUT | |
| echo "ℹ️ Commit message does not trigger release" | |
| fi | |
| release: | |
| needs: check-commit-message | |
| if: needs.check-commit-message.outputs.should-release == 'true' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '16' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Run build | |
| run: yarn build || grunt build || echo "No build script found" | |
| - name: Extract version from package.json | |
| id: package-version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "📦 Version: $VERSION" | |
| - name: Create GitHub Release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: v.fuddy-duddy-${{ steps.package-version.outputs.version }} | |
| release_name: Release v${{ steps.package-version.outputs.version }} | |
| body: | | |
| Release version ${{ steps.package-version.outputs.version }} | |
| Triggered by commit: ${{ github.event.head_commit.message }} | |
| draft: false | |
| prerelease: false |