-
-
Notifications
You must be signed in to change notification settings - Fork 108
60 lines (51 loc) · 1.69 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
name: Release
on:
workflow_dispatch:
inputs:
dryRun:
description: "Do a dry run to preview instead of a real release"
required: true
default: "true"
jobs:
authorize:
name: Authorize
runs-on: ubuntu-18.04
steps:
- name: ${{ github.actor }} permission check to do a release
uses: octokit/[email protected]
with:
route: GET /repos/:repository/collaborators/${{ github.actor }}
repository: ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: Release
runs-on: ubuntu-18.04
needs: [authorize]
env:
stable-node-version: "16.x"
e2e-eslint-version: "eslint@8" # Used because e2e and benchmark tests use ESLint's Node.js API class introduced in eslint@7
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.stable-node-version}}
cache: npm
- name: Install dependencies
run: npm ci && npm i -D ${{ env.e2e-eslint-version }}
- name: Run tests
run: npm test && npm run spec:e2e
- name: Release --dry-run # Uses release.config.js
if: ${{ github.event.inputs.dryRun == 'true'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release --dry-run
- name: Release # Uses release.config.js
if: ${{ github.event.inputs.dryRun == 'false'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release