-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:hop-protocol/hop into production
- Loading branch information
Showing
141 changed files
with
13,241 additions
and
10,965 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,21 @@ | ||
# @DEV: The cache hangs when using PNPM on certain local environments. Comment it out | ||
# when running locally. You only lose the cacheing of pnpm install. | ||
# https://github.com/actions/setup-node/issues/824 | ||
|
||
name: Setup | ||
description: Common setup steps used by our workflows | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 | ||
with: | ||
version: 9 | ||
run_install: false | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 | ||
with: | ||
node-version-file: '.nvmrc' | ||
registry-url: https://registry.npmjs.org | ||
# cache: 'pnpm' |
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,56 @@ | ||
name: Checks the status of the local package.json and packages | ||
on: | ||
workflow_call: | ||
inputs: | ||
package-name: | ||
type: string | ||
description: Name of the package | ||
outputs: | ||
npm-version-changed: | ||
description: 'Returns a boolean indicating if there is an NPM version mismatch between the local package.json and the NPM registry.' | ||
value: ${{ jobs.check.outputs.npm-version-changed }} | ||
modified-packages: | ||
description: 'Returns a list of all packages (i.e. `packages/sdk`) that have been modified in any way.' | ||
value: ${{ jobs.check.outputs.modified-packages }} | ||
is-package-modified: | ||
description: 'Returns a boolean indicating if the passed-in package was changed in any way.' | ||
value: ${{ jobs.check.outputs.is-package-modified }} | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
npm-version-changed: ${{ steps.check-npm.outputs.npm-version-changed }} | ||
modified-packages: ${{ steps. modified-packages.outputs.all_changed_files }} | ||
is-package-modified: ${{ steps.did-change.outputs.is-package-modified }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b | ||
|
||
- name: Get local and current versions | ||
id: check-npm | ||
working-directory: ./packages/sdk | ||
run: | | ||
CURRENT_VERSION=$(npm info . --json | jq -r '."dist-tags".latest') | ||
LOCAL_VERSION=$(jq -r '.version' package.json) | ||
if [[ "$CURRENT_VERSION" != "$LOCAL_VERSION" ]]; then | ||
echo "npm-version-changed=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "npm-version-changed=false" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Get modified packages | ||
id: modified-packages | ||
uses: tj-actions/changed-files@a29e8b565651ce417abb5db7164b4a2ad8b6155c | ||
with: | ||
dir_names: 'true' | ||
dir_names_max_depth: 2 | ||
|
||
- name: Check if passed in package changed | ||
id: did-change | ||
run: | | ||
if [[ "${{ steps.modified-packages.outputs.all_changed_files }}" == *"packages/${{ inputs.package-name }}"* ]]; then | ||
echo "is-package-modified=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "is-package-modified=false" >> $GITHUB_OUTPUT | ||
fi |
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 |
---|---|---|
@@ -1,36 +1,13 @@ | ||
name: Simple Github Action for Debugging Builds | ||
name: Publish Packages to NPM if Necessary | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
- TODO | ||
env: | ||
BRANCH_NAME: ${{ github.ref_name }} | ||
|
||
jobs: | ||
build: | ||
if: false | ||
name: Build | ||
debug: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: . | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 20 | ||
registry-url: https://registry.npmjs.org | ||
|
||
- name: Install node dependencies | ||
run: | | ||
npm install -g [email protected] [email protected] # required to build @eth-optimism packages | ||
pnpm install | ||
- name: Build the frontend app | ||
env: | ||
PUBLIC_URL: . | ||
REACT_APP_NETWORK: goerli | ||
REACT_APP_IPFS_BUILD: true | ||
run: NODE_OPTIONS=--openssl-legacy-provider pnpm build | ||
|
||
- run: echo 'Debug' |
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,67 @@ | ||
name: Publish Packages to Docker Hub if Necessary | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
- production | ||
paths: | ||
- 'packages/hop-node/**' | ||
- 'packages/v2-explorer-backend/**' | ||
|
||
env: | ||
DOCKER_TAG: ${{ (github.ref_name == 'develop' && 'unstable') || (github.ref_name == 'production' && 'latest') }} | ||
|
||
# TODO: DRY | ||
|
||
jobs: | ||
check-modified-hop-node: | ||
uses: ./.github/workflows/check-modified.yml | ||
with: | ||
package-name: hop-node | ||
|
||
check-modified-v2-explorer-backend: | ||
uses: ./.github/workflows/check-modified.yml | ||
with: | ||
package-name: v2-explorer-backend | ||
|
||
publish-docker-hop-node: | ||
needs: check-modified-hop-node | ||
if: needs.check-modified-hop-node.outputs.npm-version-changed == 'true' || github.ref_name != 'production' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Publish Docker image | ||
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 | ||
with: | ||
file: ./packages/hop-node/Dockerfile | ||
tags: hopprotocol/hop-node:${{ env.DOCKER_TAG }} | ||
push: true | ||
|
||
publish-docker-v2-explorer-backend: | ||
needs: check-modified-v2-explorer-backend | ||
if: needs.check-modified-check-modified-v2-explorer-backend.outputs.npm-version-changed == 'true' || github.ref_name != 'production' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Publish Docker image | ||
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 | ||
with: | ||
file: ./packages/v2-explorer-backend/Dockerfile | ||
tags: hopprotocol/v2-explorer-backend:${{ env.DOCKER_TAG }} | ||
push: true |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.