-
Notifications
You must be signed in to change notification settings - Fork 8
60 lines (51 loc) · 1.82 KB
/
npm-publish.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# @format
name: release-if-necessary
on:
push:
branches:
- main
workflow_dispatch:
jobs:
release-if-necessary:
runs-on: ubuntu-latest
strategy:
matrix:
package:
- '@requestnetwork/add-stakeholder'
- '@requestnetwork/create-invoice-form'
- '@requestnetwork/invoice-dashboard'
- '@requestnetwork/payment-widget'
- '@requestnetwork/single-invoice'
steps:
- name: Checkout repository 🛎️
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies 📥
run: npm ci
- name: Make scripts executable
run: |
chmod +x ./scripts/check-release-type.sh
chmod +x ./scripts/publish-next-release.sh
- name: Check release type 🕵️♀️
id: check-release
run: |
RELEASE_TYPE=$(npm run check-release-type --workspace=${{ matrix.package }} --silent)
echo "release-type=$RELEASE_TYPE" >> $GITHUB_OUTPUT
- name: Publish stable version 📦
if: steps.check-release.outputs.release-type == 'stable'
run: npm publish --workspace=${{ matrix.package }}
env:
NODE_AUTH_TOKEN: ${{ secrets.REQUEST_BOT_NPM_TOKEN }}
VITE_WEB3MODAL_PROJECT_ID: ${{ secrets.VITE_WEB3MODAL_PROJECT_ID }}
- name: Publish next version 📦
if: steps.check-release.outputs.release-type == 'next'
run: npm run publish-next-release --workspace=${{ matrix.package }}
env:
NODE_AUTH_TOKEN: ${{ secrets.REQUEST_BOT_NPM_TOKEN }}
VITE_WEB3MODAL_PROJECT_ID: ${{ secrets.VITE_WEB3MODAL_PROJECT_ID }}