This commit is contained in:
2026-03-11 19:35:05 +00:00
parent 6b47d30961
commit a372a43947
2 changed files with 47 additions and 5 deletions
+32 -5
View File
@@ -1,12 +1,21 @@
name: Test and Release
on:
workflow_dispatch:
push:
branches: [main]
paths-ignore:
- "**.md"
- "**/release.yml"
- "static/**"
- "docs/**"
pull_request:
branches: [main]
release:
types: [published]
permissions:
id-token: write
contents: write
packages: write
jobs:
test:
@@ -24,16 +33,34 @@ jobs:
release:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'release'
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: '20'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- name: Run GoReleaser
if: steps.version.outputs.version_tag != ''
uses: goreleaser/goreleaser-action@v6
with:
version: latest