-
Notifications
You must be signed in to change notification settings - Fork 2.2k
93 lines (79 loc) · 2.82 KB
/
library-solidity-publish.yml
File metadata and controls
93 lines (79 loc) · 2.82 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
88
89
90
91
92
93
name: library-solidity-publish
on:
workflow_dispatch:
inputs:
release:
description: "Set to true for release tagging"
required: false
default: false
permissions: {}
jobs:
publish:
name: library-solidity-publish/publish
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./library-solidity
permissions:
contents: "read" # Required to checkout repository code
id-token: "write" # Required for OIDC authentication
packages: "write" # Required to publish Docker images
steps:
- name: Check out repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: "false"
- name: Set up Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20.x
- name: Update npm # required by trusted publishing
run: npm install -g npm@11.7.0
- name: Prepare environment file
working-directory: library-solidity
run: cp .env.example .env
- name: Install dependencies
working-directory: library-solidity
run: npm ci --include=optional
- name: Compile library
working-directory: library-solidity
run: npm run compile
- name: Publish prerelease to npm
if: ${{ inputs.release != 'true' }}
uses: JS-DevTools/npm-publish@7f8fe47b3bea1be0c3aec2b717c5ec1f3e03410b # v4.1.1
with:
package: ./library-solidity/package.json
tag: prerelease
provenance: true
access: public
- name: Publish release to npm
if: ${{ inputs.release == 'true' }}
uses: JS-DevTools/npm-publish@7f8fe47b3bea1be0c3aec2b717c5ec1f3e03410b # v4.1.1
with:
package: ./library-solidity/package.json
provenance: true
access: public
publish-soldeer:
name: library-solidity-publish/publish-soldeer
if: ${{ inputs.release == 'true' }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./library-solidity
permissions:
contents: "read"
steps:
- name: Check out repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: "false"
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@8789b3e21e6c11b2697f5eb56eddae542f746c10 # v1
- name: Read version from package.json
id: version
run: echo "version=$(node -p 'require("./package.json").version')" >> "$GITHUB_OUTPUT"
- name: Publish to Soldeer
env:
SOLDEER_API_TOKEN: ${{ secrets.SOLDEER_TOKEN }}
VERSION: ${{ steps.version.outputs.version }}
run: forge soldeer push "@fhevm-solidity~${VERSION}" . --skip-warnings