-
Notifications
You must be signed in to change notification settings - Fork 38
69 lines (58 loc) · 2.21 KB
/
Copy pathsemantic-release.yml
File metadata and controls
69 lines (58 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Bumps package.json / CHANGELOG.md and creates Git tags via semantic-release from conventional commits.
# Optional secret SEMANTIC_RELEASE_GITHUB_TOKEN (PAT with contents:write) improves push reliability;
# if unset, GITHUB_TOKEN is used as GH_TOKEN / GITHUB_TOKEN per semantic-release documentation.
name: Semantic Release
on:
workflow_dispatch:
concurrency:
group: semantic-release-${{ github.repository }}-${{ github.ref }}
cancel-in-progress: false
jobs:
semantic-release:
environment: production
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true
token: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Run Go tests
working-directory: crossview-go-server
run: go test ./...
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: |
npm ci
npm install --no-save @rollup/rollup-linux-x64-gnu || true
- name: Run npm audit
run: |
echo "Checking for npm vulnerabilities..."
npm audit --audit-level=moderate || echo "⚠️ Some vulnerabilities found, but continuing build"
- name: Run semantic-release
env:
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
run: npx semantic-release --ci
- name: Report result
if: always()
run: |
if [ -f .semantic-release-version ]; then
VERSION=$(tr -d '\n\r' < .semantic-release-version)
echo "Published version ${VERSION} (tag v${VERSION})."
echo "### Published v${VERSION}" >> "$GITHUB_STEP_SUMMARY"
else
echo "No new semantic version published (nothing releasable)."
echo "### No release published" >> "$GITHUB_STEP_SUMMARY"
fi