-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (45 loc) · 1.35 KB
/
publish.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
name: Release
on:
workflow_dispatch:
inputs:
dry-run:
required: true
description: 'Run dry run?'
type: boolean
default: true
push:
branches:
- main
jobs:
release:
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Set dry run env variable
run: |
if [ "${{ github.event.inputs.dry-run }}" == "true" ]; then
echo "PUBLISH=--dry-run" >> $GITHUB_ENV
fi
- name: Fresh install
run: yarn install --immutable --immutable-cache --check-cache
- name: Clean dist
run: yarn clean
- name: Build
run: yarn build
- name: Install Semantic Release and plugins
run: yarn global add semantic-release @semantic-release/git @semantic-release/changelog @semantic-release/github @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/npm
- run: npx semantic-release $(echo "${{ env.PUBLISH }}")
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}