-
Notifications
You must be signed in to change notification settings - Fork 4
70 lines (67 loc) · 1.99 KB
/
publish-releases.yml
File metadata and controls
70 lines (67 loc) · 1.99 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Release & Publish
on:
workflow_dispatch:
inputs:
package:
description: "The package name to be released (e.g @bitify/api-gateway). If empty every packages will be released"
type: string
jobs:
setup-node_modules:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2.4.0
- uses: actions/setup-node@v3
with:
node-version: 20
cache: "pnpm"
- uses: "nick-fields/retry@v2.9.0"
with:
max_attempts: 10
timeout_minutes: 15
retry_on: error
command: pnpm fetch --ignore-scripts
publish:
needs: setup-node_modules
runs-on: ubuntu-latest
environment: main
permissions:
contents: write
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v2.4.0
- uses: actions/setup-node@v3
with:
node-version: "18"
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
- uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: git config
run: |
git config user.name "fasenderos"
git config user.email "fasenderos@gmail.com"
- name: Install dependencies
uses: nick-fields/retry@v2.9.0
with:
max_attempts: 10
timeout_minutes: 15
retry_on: error
command: pnpm install --frozen-lockfile
- name: Release packages
run: |
if [ "${{ github.event.inputs.package }}" != "" ];
then
PATH="$(node ./scripts/get-package-from-tag.js '${{ github.ref_name }}')"
if [! -z "$PATH" ]; then cd $PATH; fi
fi
pnpm release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}