Skip to content

Commit

Permalink
Tweak build structure for npm publish, publish github action (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
sammccord authored Dec 1, 2022
1 parent ee7cb72 commit f21fc2d
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 141 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ jobs:
run: forge install

- name: Check if forge fmt was run
run: forge fmt --check
run: forge fmt --check
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish NPM Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run forge install
run: forge install

- name: Run forge build
run: forge build

- name: Run tests
env:
RPC_URL: ${{ secrets.RPC_URL }}
run: forge test -vvv

publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules
typechain_types/

# Forge
build/
out/
cache/
broadcast/
Expand Down
4 changes: 0 additions & 4 deletions deployments/addresses_last.example.json

This file was deleted.

1 change: 0 additions & 1 deletion deployments/addresses_last.json

This file was deleted.

4 changes: 2 additions & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[profile.default]
src = 'src'
out = 'out'
out = 'build/abis'
libs = ['lib']
fs_permissions = [{ access = "read-write", path = "./"}]


[fmt]
line_length = 100
# See more config options https://github.com/foundry-rs/foundry/tree/master/config
# See more config options https://github.com/foundry-rs/foundry/tree/master/config
Loading

0 comments on commit f21fc2d

Please sign in to comment.