This repository was archived by the owner on Aug 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (73 loc) · 2.41 KB
/
Copy pathrelease.yml
File metadata and controls
86 lines (73 loc) · 2.41 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Release
on:
push:
branches:
- main
- master
workflow_dispatch:
inputs:
dry_run:
description: "Run semantic-release in dry-run mode"
required: false
default: false
type: boolean
permissions:
contents: write
packages: write
issues: write
jobs:
release:
name: Verify, Build & Release (bun + semantic-release)
runs-on: ubuntu-latest
steps:
- name: Checkout repository (full history)
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "latest"
- name: Print environment info
run: |
echo "Workspace: $(pwd)"
echo "uname: $(uname -a)"
bun --version || true
node --version || echo "node not found"
- name: Install dependencies (bun)
run: |
bun install
- name: Run tests
run: |
bun run test
- name: Run lint
run: |
bun run lint
- name: Typecheck
run: |
bun run typecheck
- name: Build
run: |
bun run build
- name: Configure npm auth
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Run semantic-release (publish)
env:
# npm automation token; required by @semantic-release/npm or publish commands
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# Many npm tools read NODE_AUTH_TOKEN for publishing; expose both to be safe
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# GitHub token used by semantic-release plugins to create GitHub Releases, push tags, etc.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Decide whether to run in dry-run mode based on the workflow_dispatch input `dry_run`.
# When triggered via workflow_dispatch, users can set the `dry_run` input to true to
# exercise the release process without actually publishing or pushing tags.
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.dry_run }}" = "true" ]; then
echo "Dry run requested — running semantic-release --dry-run"
bunx semantic-release --dry-run
else
echo "Running semantic-release (publish)"
bunx semantic-release
fi