-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.09 KB
/
semantic-release.yml
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
name: Release
on:
push:
branches:
- main # Trigger only on pushes to the main branch
workflow_dispatch: # Allow manual triggering
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Required for Semantic Release to access full git history
- name: Set up SSH key for tags
env:
SSH_DEPLOY_KEY: ${{ secrets.SEMRELEASE_DEPLOY_KEY }}
run: |
mkdir -p ~/.ssh
echo "${SSH_DEPLOY_KEY}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20' # Use the latest Node.js version here
- name: Install dependencies
run: npm install # Assumes the project uses npm; adjust if using yarn or pnpm
- name: Run Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SSH_AUTH_SOCK: /tmp/ssh_auth.sock
run: npx semantic-release