-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (59 loc) · 2.06 KB
/
release.yml
File metadata and controls
69 lines (59 loc) · 2.06 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
name: Release
on:
push:
branches:
- main
workflow_dispatch:
# Allow manual trigger for emergency releases
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to create releases and push commits
issues: write # to comment on released issues
pull-requests: write # to comment on released PRs
id-token: write # for npm provenance and trusted publishing
steps:
- name: 📥 Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for semantic-release
# Persist credentials for commits during release
# persist-credentials: false
ssh-key: ${{ secrets.RELEASE_SSH_KEY }}
- name: 🟢 Setup Node
uses: actions/setup-node@v4
with:
node-version: "24" # 24 or Higher LTS
cache: "npm"
registry-url: "https://registry.npmjs.org"
- name: 🔼 Upgrade NPM
run: npm install -g npm@latest
- name: 📦 Install dependencies
run: npm ci
- name: 🛡️ Validate before release
run: |
echo "Running pre-release validation..."
npm run typecheck
npm run lint
npm run test
npm run build
- name: 🚀 Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
HUSKY: 0
run: |
# Configure git for commits by semantic-release
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Run semantic-release (using SSH deploy key from checkout)
npx semantic-release
- name: 📊 Release Summary
if: success()
run: |
echo "✅ Release process completed successfully"
echo "Check the releases page: https://github.com/${{ github.repository }}/releases"
echo "Check npm: https://www.npmjs.com/package/@youversion/react-native-sdk"