Release pipeline fix #4
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: Build and Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'src/**' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test | |
| - name: Build project | |
| run: npm run build | |
| - name: Verify build artifacts | |
| run: | | |
| echo "Checking build artifacts..." | |
| ls -la dist/flowquery.min.js || echo "dist/flowquery.min.js not found" | |
| - name: Generate version tag | |
| id: version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| TIMESTAMP=$(date +%Y%m%d-%H%M%S) | |
| TAG="v${VERSION}-${TIMESTAMP}" | |
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ steps.version.outputs.tag }} | |
| name: Release ${{ steps.version.outputs.tag }} | |
| body: | | |
| Automated release from main branch | |
| Version: ${{ steps.version.outputs.version }} | |
| Commit: ${{ github.sha }} | |
| files: dist/flowquery.min.js | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |