-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (38 loc) · 1.33 KB
/
releaser.yaml
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
name: Release and Publish
on:
push:
branches:
- main
jobs:
build:
name: Release and Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Release
uses: justincy/[email protected]
id: release
- name: Print release output
if: ${{ steps.release.outputs.released == 'true' }}
run: echo Release ID ${{ steps.release.outputs.release_id }}
# Publish to npm only if release was successful
- name: Set up Node.js environment (if release successful)
uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.released == 'true' }}
- name: Install dependencies (if release successful)
run: yarn install --frozen-lockfile
if: ${{ steps.release.outputs.released == 'true' }}
- name: Publish to npm (if release successful)
run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
BASE_URL: ${{ secrets.BASE_URL }}
USER_NAME: ${{ secrets.USER_NAME }}
USER_PASSWORD: ${{ secrets.USER_PASSWORD }}
DATABASE_NAME: ${{ secrets.DATABASE_NAME }}
if: ${{ steps.release.outputs.released == 'true' }}