-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
867 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: auto-merge | ||
on: pull_request | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
dependabot: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
steps: | ||
- name: Dependabot metadata | ||
id: metadata | ||
uses: dependabot/fetch-metadata@v2 | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
- name: Enable auto-merge for Dependabot PRs | ||
run: gh pr merge --auto --merge "$PR_URL" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
- name: Approve a PR | ||
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}} | ||
run: gh pr review --approve "$PR_URL" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: CD | ||
on: | ||
release: | ||
types: | ||
- released | ||
concurrency: | ||
group: "stylebot" | ||
cancel-in-progress: true | ||
permissions: | ||
id-token: write | ||
contents: write | ||
pull-requests: write | ||
jobs: | ||
publish-package: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/create-github-app-token@v1 | ||
id: app-token | ||
with: | ||
app-id: ${{ vars.RELEASEBOT_APP_ID }} | ||
private-key: ${{ secrets.RELEASEBOT_PRIVATE_KEY }} | ||
- uses: actions/checkout@master | ||
with: | ||
fetch-depth: 0 | ||
- run: echo "package_version=$(jq -r .version package.json)" >> $GITHUB_ENV | ||
- if: ${{ github.event.release.name != env.package_version }} | ||
run: 'echo "Error: Tag name does not match package.json version" && exit 1' | ||
- id: nodeversion | ||
run: echo "::set-output name=version::$(grep nodejs .tool-versions | sed -e 's/[^[:space:]]*[[:space:]]*//')" | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ steps.nodeversion.outputs.version }} | ||
cache: yarn | ||
registry-url: "https://registry.npmjs.org" | ||
token: ${{ secrets.NPM_TOKEN }} | ||
- run: | | ||
echo "npmRegistries:" >> .yarnrc.yml | ||
echo ' "https://registry.npmjs.org":' >> .yarnrc.yml | ||
echo " npmAlwaysAuth: true" >> .yarnrc.yml | ||
echo " npmAuthToken: ${{ secrets.NPM_TOKEN }}" >> .yarnrc.yml | ||
- run: yarn install --immutable | ||
- run: yarn build:hardhat | ||
- run: yarn build:tsc | ||
- run: yarn publish --patch --access public --non-interactive | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
commit-message: "[releasebot] Updates version post-release" | ||
branch: releasebot/version-update | ||
title: "[releasebot] Updates version post-release" | ||
token: ${{ steps.app-token.outputs.token }} | ||
body: | | ||
The following files have been updated as a result of releasing version: ${{ env.package_version }}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: CI | ||
on: [push] | ||
permissions: | ||
contents: read | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
with: | ||
fetch-depth: 0 | ||
- id: nodeversion | ||
run: echo "::set-output name=version::$(grep nodejs .tool-versions | sed -e 's/[^[:space:]]*[[:space:]]*//')" | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ steps.nodeversion.outputs.version }} | ||
cache: yarn | ||
- run: yarn install --immutable | ||
- run: yarn check:eslint || true | ||
- run: yarn check:prettier || true | ||
- run: yarn build:hardhat | ||
- run: yarn build:tsc | ||
- run: yarn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: stylebot | ||
on: | ||
push: | ||
branches: | ||
- main | ||
concurrency: | ||
group: "stylebot" | ||
cancel-in-progress: true | ||
permissions: | ||
id-token: write | ||
contents: write | ||
pull-requests: write | ||
jobs: | ||
fix: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/create-github-app-token@v1 | ||
id: app-token | ||
with: | ||
app-id: ${{ secrets.STYLEBOT_GITHUB_APP_ID }} | ||
private-key: ${{ secrets.STYLEBOT_GITHUB_APP_KEY }} | ||
- uses: actions/checkout@master | ||
- id: nodeversion | ||
run: echo "::set-output name=version::$(grep nodejs .tool-versions | sed -e 's/[^[:space:]]*[[:space:]]*//')" | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ steps.nodeversion.outputs.version }} | ||
cache: yarn | ||
- run: yarn install --immutable | ||
# Run fixes, save stdout. | ||
- run: | | ||
echo 'ESLINT_RESULTS<<EOF' >> ${GITHUB_ENV} | ||
yarn fix:eslint || true >> ${GITHUB_ENV} | ||
echo 'EOF' >> ${GITHUB_ENV} | ||
- run: | | ||
echo 'PRETTIER_RESULTS<<EOF' >> ${GITHUB_ENV} | ||
yarn fix:prettier >> ${GITHUB_ENV} | ||
echo 'EOF' >> ${GITHUB_ENV} | ||
# Make PR from local changes. | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
token: ${{ steps.app-token.outputs.token }} | ||
commit-message: "[stylebot] Fixes for code style" | ||
branch: stylebot/patch | ||
title: "[stylebot] Fixes for code style" | ||
body: | | ||
Stylebot detected automatically fix-able code style issues. | ||
`yarn fix:eslint`: | ||
``` | ||
${{ env.ESLINT_RESULTS }} | ||
``` | ||
`yarn fix:prettier`: | ||
``` | ||
${{ env.PRETTIER_RESULTS }} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
node_modules | ||
.env | ||
.tool-versions | ||
.prettierrc | ||
eslint.config.mjs | ||
hardhat.config.ts | ||
|
||
# Hardhat files | ||
/cache | ||
/test | ||
|
||
# solidity-coverage files | ||
/coverage | ||
/coverage.json | ||
|
||
/.github | ||
|
||
/*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// @ts-check | ||
|
||
import eslint from "@eslint/js"; | ||
import tseslint from "typescript-eslint"; | ||
|
||
export default tseslint.config( | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommended, | ||
{ | ||
ignores: [ | ||
"**/*.js", | ||
"node_modules/", | ||
"artifacts/", | ||
"cache/", | ||
".github/", | ||
"hardhat.config.ts", | ||
], | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.