-
Notifications
You must be signed in to change notification settings - Fork 25
53 lines (46 loc) · 1.24 KB
/
release.yml
File metadata and controls
53 lines (46 loc) · 1.24 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
name: Release & Publish to NPM
on:
workflow_dispatch:
inputs:
release-type:
description: "Release type"
required: true
default: "preview"
type: choice
options:
- patch
- minor
- major
- preview
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
- name: Setup
uses: ./.github/actions/setup
- name: Initialize Git user
shell: bash
run: |
git config user.name "github-actions"
git config user.email "mwlawlor@gmail.com"
- name: Setup NPM registry
run: |
npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Run release
run: |
if [ "${{ inputs.release-type }}" = "preview" ]; then
yarn release --ci --preRelease=preview
else
yarn release --ci --increment=${{ inputs.release-type }}
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}