Skip to content

Commit 3362f78

Browse files
committed
Fix publish to NPM. Publish to Soldeer
1 parent ab70165 commit 3362f78

File tree

5 files changed

+23
-10
lines changed

5 files changed

+23
-10
lines changed

.github/actions/setup/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: Setup Node environment
33
runs:
44
using: composite
55
steps:
6-
- uses: actions/setup-node@v4
6+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
77
with:
88
node-version: 20.x
99
cache: yarn
1010

1111
- name: Install dependencies
1212
run: yarn --frozen-lockfile --prefer-offline
13-
shell: bash
13+
shell: bash

.github/workflows/publish.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,22 @@ jobs:
1414
runs-on: ubuntu-latest
1515
environment: publish
1616
steps:
17-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
17+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1818
with:
1919
fetch-depth: 0 # To get all tags
2020
ref: ${{ github.ref }}
2121
- name: Set up environment
2222
uses: ./.github/actions/setup
23+
- name: Install Foundry
24+
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0
2325
- name: Create Prepare Release PR or Publish
2426
id: changesets
2527
uses: changesets/action@746c25e23caa47dceb6a48ee85b4cbc5a9f5f293 # v1.5.0
2628
with:
2729
title: Prepare Release
2830
commit: Prepare Release
29-
version: npm run version
30-
publish: npm run publish
31+
version: npm run version-package
32+
publish: npm run publish-package
3133
commitMode: github-api
3234
env:
3335
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -42,3 +44,14 @@ jobs:
4244
run: |
4345
echo "Publish failed. Check the logs for more details."
4446
exit 1
47+
- name: Publish to Soldeer
48+
if: steps.changesets.outputs.published == 'true'
49+
run: |
50+
mkdir -p ~/.soldeer
51+
echo "$SOLDEER_TOKEN" > ~/.soldeer/.soldeer_login
52+
PACKAGE_VERSION=$(jq -r .version package.json)
53+
echo "Publishing version $PACKAGE_VERSION to Soldeer..."
54+
forge soldeer push openzeppelin-foundry-upgrades~$PACKAGE_VERSION
55+
shell: bash
56+
env:
57+
SOLDEER_TOKEN: ${{ secrets.SOLDEER_TOKEN }}

.github/workflows/version.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
pull-requests: write
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
18+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1919
with:
2020
fetch-depth: 0 # To get all tags
2121
ref: ${{ github.ref }}
@@ -26,7 +26,7 @@ jobs:
2626
with:
2727
title: Prepare Release
2828
commit: Prepare Release
29-
version: npm run version
29+
version: npm run version-package
3030
commitMode: github-api
3131
env:
3232
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.soldeerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Assumes .gitignore's contents are automatically included
22

3-
.git/
3+
.*

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"lint:fix": "prettier --log-level warn --ignore-path .gitignore '{src,test}/**/*.sol' --write",
2626
"docgen": "hardhat clean && hardhat compile && hardhat docgen",
2727
"docgen:test": "yarn docgen && git diff --exit-code docs/modules/api/pages",
28-
"version": "bash scripts/release/version.sh",
29-
"publish": "bash scripts/release/publish.sh"
28+
"version-package": "bash scripts/release/version.sh",
29+
"publish-package": "bash scripts/release/publish.sh"
3030
},
3131
"devDependencies": {
3232
"@nomicfoundation/hardhat-foundry": "^1.1.1",

0 commit comments

Comments
 (0)