Files
cloudflare-crawl-mcp/.github/workflows/release.yml
T
lukaszraczylo 0249d13265 - [x] Remove npm ci and version steps from release.yml
- [x] Add .goreleaser-dist to .gitignore
- [x] Configure dist dir and before hook in goreleaser.yaml
2026-03-11 21:52:13 +00:00

72 lines
1.8 KiB
YAML

name: Test and Release
on:
workflow_dispatch:
push:
branches: [main]
paths-ignore:
- "**.md"
- "**/release.yml"
- "static/**"
- "docs/**"
pull_request:
branches: [main]
permissions:
id-token: write
contents: write
packages: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm test
release:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Calculate version
id: version
uses: lukaszraczylo/shared-actions/.github/actions/semver@main
with:
config-file: semver.yaml
- name: Create tag
if: steps.version.outputs.version_tag != ''
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag ${{ steps.version.outputs.version_tag }}
git push origin ${{ steps.version.outputs.version_tag }}
- uses: actions/setup-node@v4
if: steps.version.outputs.version_tag != ''
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- name: Run GoReleaser
if: steps.version.outputs.version_tag != ''
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}