-
Notifications
You must be signed in to change notification settings - Fork 5
87 lines (70 loc) · 2.34 KB
/
manual-publish.yml
File metadata and controls
87 lines (70 loc) · 2.34 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Publish Scribe Package (scribe-v2)
on:
workflow_dispatch:
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
# Needed for nx-set-shas when run on the main branch
permissions:
actions: read
contents: read
pull-requests: read
jobs:
publish:
name: Build on ${{ matrix.os }}, node ${{ matrix.node_version }}, PNPM ${{ matrix.pnpm_version }}
runs-on: ${{ matrix.os }}
if: github.ref != 'refs/heads/main'
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node_version: [20]
pnpm_version: [10]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Install PNPM
uses: pnpm/action-setup@v3
with:
version: ${{ matrix.pnpm_version }}
- name: Install Node.js and npm
uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org/"
node-version: ${{ matrix.node_version }}
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4
- name: Check formatting
run: |
pnpm prettier --check .
pnpm nx format:check
- name: Check linting
run: pnpm nx affected -t lint
- name: Check types
run: pnpm nx affected -t typecheck
- name: Check tests
run: pnpm nx affected -t test
- name: Production build
run: pnpm nx affected -t build
- name: Publish scribe package
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
cd ./packages/scribe
pnpm publish --no-git-checks --access public --tag scribe-v2
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Error handling and file content
if: failure()
run: |
echo "An error occurred during the workflow execution."
echo "Current branch: ${{ github.ref }}"
echo "Current workflow file content:"
cat ${{ github.workflow }}
echo "Directory structure:"
ls -R
echo "Workflow run URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"