Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: alpha releases #21

Merged
merged 4 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,22 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: bun install
- name: Build
run: bun run build
# the following steps are only running for:
# - pull_requests (not pushes to master)
# - pull requests from contributors (not forks)
- name: Alpha
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
run: |
bun i -g standard-version
standard-version --prerelease ${{ github.sha }} --skip.changelog --skip.commit --skip.tag
npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
2 changes: 2 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Networks } from "./types";
const packageJson = require("../package.json");
export const VERIFY_VERSION = packageJson.version;

export const VERBOSE = !!process.env.VERBOSE;

export const ETHERSCAN_API_KEYS: {
[key: number]: string;
} = {
Expand Down
9 changes: 6 additions & 3 deletions src/utils/explorer-api.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { ETHERSCAN_API_KEYS, ETHERSCAN_API_URL } from "../config";
import { ETHERSCAN_API_KEYS, ETHERSCAN_API_URL, VERBOSE } from "../config";
import { delay } from "./misc";

export const submitVerification = async (verificationInfo: any, chainId: number, etherscanUrl?: string) => {
const request = await fetch(etherscanUrl || ETHERSCAN_API_URL[chainId], {
const params = {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
body: new URLSearchParams(verificationInfo).toString(),
});
};
// etherscan is not super stable, therefore sometimes there are issues and for reporting it's useful to log the request
if (VERBOSE) console.log("etherscan request", JSON.stringify(params));
const request = await fetch(etherscanUrl || ETHERSCAN_API_URL[chainId], params);

return await request.json();
};
Expand Down
Loading