-
Notifications
You must be signed in to change notification settings - Fork 8
62 lines (52 loc) · 1.62 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Release
on:
workflow_dispatch:
inputs:
dryRun:
type: boolean
default: true
required: false
description: 'Run in dry-run mode (no actual release)'
env:
node-version: 20.x
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
# Check permissions
- uses: tspascoal/get-user-teams-membership@v3
id: permissions
with:
username: ${{ github.actor }}
team: 'ESL Core Maintainers'
GITHUB_TOKEN: ${{ secrets.PERMISSION_CHECK_TOKEN }}
- if: ${{ steps.permissions.outputs.isTeamMember == 'true' }}
name: Access Check Passed
run: echo ${{ github.actor }} is in 'ESL Core Maintainers' group
- if: ${{ steps.permissions.outputs.isTeamMember == 'false' }}
name: Access Denied
run: exit 1
# Start workflow
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node v${{ env.node-version }}
uses: actions/setup-node@v4
with:
cache: 'npm'
node-version: ${{ env.node-version }}
- name: Install NPM Dependencies
run: npm ci
- name: Run Semantic Release in Dry Run mode
if: ${{ inputs.dryRun }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: npx semantic-release --dry-run
- name: Run Semantic Release
if: ${{ !inputs.dryRun }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: npx semantic-release