-
Notifications
You must be signed in to change notification settings - Fork 5
79 lines (60 loc) · 2.23 KB
/
publish.yml
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
name: Publish
on:
workflow_call:
secrets:
NPM_TOKEN:
required: true
jobs:
publish:
strategy:
fail-fast: false
matrix:
package:
- test
- test-wagmi
- morpho-ts
- morpho-test
- blue-api-sdk
- blue-sdk
- blue-sdk-ethers
- blue-sdk-viem
- blue-sdk-wagmi
- simulation-sdk
- simulation-sdk-wagmi
- bundler-sdk-ethers
- bundler-sdk-viem
- liquidation-sdk-viem
- liquidity-sdk-ethers
- liquidity-sdk-viem
- migration-sdk-viem
name: "@morpho-org/${{ matrix.package }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Fetch all history so that we can determine the version to release.
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
- run: pnpm install --frozen-lockfile
- id: release
run: node ../../scripts/release/release.js
working-directory: packages/${{ matrix.package }}
# Set version of each package to the most recent so they are referenced correctly in dependencies.
- run: |
pnpm -r -c exec 'node ../../scripts/release/version.js'
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
echo "${{ steps.release.outputs.changelog }}" > CHANGELOG.md
if: steps.release.outputs.version
- run: pnpm publish --no-git-checks --access public --tag ${{ steps.release.outputs.channel }}
working-directory: packages/${{ matrix.package }}
if: steps.release.outputs.version
- run: gh release create ${{ steps.release.outputs.tag }} --target ${{ steps.release.outputs.branch }} --notes-file CHANGELOG.md --title '${{ steps.release.outputs.tag }}' ${{ steps.release.outputs.channel == 'latest' && '--latest' || '--prerelease' }}
if: steps.release.outputs.version
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: echo "- [RELEASE] ${{ steps.release.outputs.version }}" >> $GITHUB_STEP_SUMMARY
if: steps.release.outputs.version