diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..f8d9a85 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,63 @@ +name: Build + +on: + workflow_call: + inputs: + version_type: + required: true + type: string + description: "The type of version bump (commit, pr, release)" + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 + - name: Set up Docker Compose + run: | + sudo apt-get update + sudo apt-get install -y docker-compose + - name: Install dependencies + run: | + npm install + - name: Build + if: inputs.version_type == 'commit' + run: | + npx @dappnode/dappnodesdk build \ + --provider "remote" \ + --verbose | tee build.log + - name: Build and publish + if: inputs.version_type == 'pr' || inputs.version_type == 'release' + run: | + npx @dappnode/dappnodesdk publish patch \ + --provider "remote" \ + --upload_to "ipfs" \ + --verbose \ + --github_release | tee build.log + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DEVELOPER_ADDRESS: "0x7305356ad936A06c4ea5DF45AD5E5C3ff9Db818E" + - name: Summarize build output + id: summarize + run: | + grep "ipfs" build.log >> $GITHUB_STEP_SUMMARY + ipfs_hash=$(grep -oP 'Release hash : \K/ipfs/\w+' build.log) + - name: Send message to Zulip + if: inputs.version_type == 'release' + uses: zulip/github-actions-zulip/send-message@v1 + with: + api-key: ${{ secrets.ZULIP_API_KEY }} + email: ${{ secrets.ZULIP_EMAIL }} + organization-url: "https://hopr.zulipchat.com" + type: "stream" + to: "HOPRd" + topic: "Releases" + content: | + A new hoprd dAppNode package (rotsee) version is available. + - IPFS Hash: ${{ steps.summarize.outputs.ipfs_hash }} + Access to your dAppNode and check for the updates + echo "ipfs_hash=$ipfs_hash" | tee -a $GITHUB_OUTPUT diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml new file mode 100644 index 0000000..4d8efa7 --- /dev/null +++ b/.github/workflows/bump.yml @@ -0,0 +1,62 @@ +name: Bump packages + +on: + repository_dispatch: + types: [release] + workflow_dispatch: + inputs: + hoprd_version: + description: 'Version of hoprd to build' + required: false + node_admin_version: + description: 'Version of node-admin to build' + required: false + + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 + - name: Set up Docker Compose + run: | + sudo apt-get update + sudo apt-get install -y docker-compose + - name: Setup variables + id: setup + run: | + default_hoprd_version=$(yq -r '.services.hoprd.build.args.UPSTREAM_VERSION' docker-compose.yml) + node_admin_image=$(yq -r '.services.admin.image' docker-compose.yml) + default_node_admin_version=$(echo $node_admin_image | cut -d: -f2) + echo "HOPRD_VERSION=${HOPRD_VERSION:-$default_hoprd_version}" | tee -a "${GITHUB_OUTPUT}" + echo "NODE_ADMIN_VERSION=${NODE_ADMIN_VERSION:-$default_node_admin_version}" | tee -a "${GITHUB_OUTPUT}" + env: + HOPRD_VERSION: ${{ github.event.inputs.hoprd_version || github.event.client_payload.hoprd_version }} + NODE_ADMIN_VERSION: ${{ github.event.inputs.node_admin_version || github.event.client_payload.node_admin_version }} + - name: Update docker-compose.yml + run: | + yq -i '.services.hoprd.build.args.UPSTREAM_VERSION = strenv(HOPRD_VERSION)' docker-compose.yml + yq -i '.services.admin.image = "europe-west3-docker.pkg.dev/hoprassociation/docker-images/hopr-admin:" + strenv(NODE_ADMIN_VERSION)' docker-compose.yml + env: + HOPRD_VERSION: ${{ steps.setup.outputs.HOPRD_VERSION }} + NODE_ADMIN_VERSION: ${{ steps.setup.outputs.NODE_ADMIN_VERSION }} + - name: Install dependencies + run: | + npm install + - name: Build + run: | + npx @dappnode/dappnodesdk build \ + --provider "remote" \ + --verbose | tee build.log + - name: Commit bumped versions + uses: EndBug/add-and-commit@290ea2c423ad77ca9c62ae0f5b224379612c0321 # v10.0.0 + with: + add: docker-compose.yml + new_branch: ${{ github.ref_name }} + message: "ci: Bump docker images" + pathspec_error_handling: ignore + default_author: user_info + github_token: ${{ secrets.github_token }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index dac25ce..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Build (experimental package) - -on: - pull_request: - push: - branches: - - develop - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Set up Docker Compose - run: | - sudo apt-get update - sudo apt-get install -y docker-compose - - - name: Build and upload to IPFS - run: | - npm install - npx @dappnode/dappnodesdk build \ - --provider "remote" \ - --verbose | tee build.log - - echo "DNP (DAppNode Package) built and uploaded" >> $GITHUB_STEP_SUMMARY - grep "ipfs" build.log >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml new file mode 100644 index 0000000..af3ce54 --- /dev/null +++ b/.github/workflows/merge.yml @@ -0,0 +1,12 @@ +name: Merge +on: + pull_request: + types: + - closed +jobs: + build: + name: Build + if: github.event.pull_request.merged == true + uses: ./.github/workflows/build.yml + with: + version_type: pr diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..0d0fb49 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,14 @@ +name: PR +on: + pull_request: + types: + - opened + - synchronize + - reopened + - ready_for_review +jobs: + build: + name: Build + uses: ./.github/workflows/build.yml + with: + version_type: commit \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85c9510..fab1a7d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,53 +1,12 @@ name: Build (release package) on: - push: - branches: - - main + + workflow_dispatch: jobs: build: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Set up Docker Compose - run: | - sudo apt-get update - sudo apt-get install -y docker-compose - - - name: Build and publish to package repository - id: publish - run: | - npm install - npx @dappnode/dappnodesdk publish patch \ - --provider "remote" \ - --upload_to "ipfs" \ - --verbose \ - --github_release | tee build.log - - echo "DNP (DAppNode Package) built and uploaded" >> $GITHUB_STEP_SUMMARY - grep "ipfs" build.log >> $GITHUB_STEP_SUMMARY - ipfs_hash=$(grep -oP 'Release hash : \K/ipfs/\w+' build.log) - echo "ipfs_hash=$ipfs_hash" >> $GITHUB_OUTPUT - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DEVELOPER_ADDRESS: "0x7305356ad936A06c4ea5DF45AD5E5C3ff9Db818E" - - - name: Send message to Zulip - uses: zulip/github-actions-zulip/send-message@v1 - with: - api-key: ${{ secrets.ZULIP_API_KEY }} - email: ${{ secrets.ZULIP_EMAIL }} - organization-url: "https://hopr.zulipchat.com" - type: "stream" - to: "HOPRd" - topic: "Releases" - content: | - A new hoprd dAppNode package (rotsee) version is available. - - IPFS Hash: ${{ steps.publish.outputs.ipfs_hash }} - Access to your dAppNode and check for the updates \ No newline at end of file + name: Build + uses: ./.github/workflows/build.yml + with: + version_type: release diff --git a/docker-compose.yml b/docker-compose.yml index 30dcf6e..2b3ddbf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: build: context: . args: - UPSTREAM_VERSION: 3.0.0@sha256:fa9764f5e9927094960f63dfb68dbf6cbc237210559a890f1effa29da6e92ecd + UPSTREAM_VERSION: 4.0.0-rc.3@sha256:81a866d276c37ec7db2a66d31b4fb30dee26143a4cf5a0a9c59078d8c99b42d8 ports: - "3101:3101/tcp" - 9191:9191/tcp diff --git a/setup-wizard.yml b/setup-wizard.yml index a99da0c..f37dbf8 100644 --- a/setup-wizard.yml +++ b/setup-wizard.yml @@ -27,18 +27,17 @@ fields: *or* if you plan to expose your REST API (port 3101) or HOPR Admin UI (port 3100) to the public. secret: true - - id: HOPRD_PROVIDER + - id: HOPRD_BLOKLI_URL target: type: environment - name: HOPRD_PROVIDER + name: HOPRD_BLOKLI_URL service: node - title: RPC Provider URL + title: Blokli URL required: false description: |- - URL to the custom RPC provider this HOPR node should use. Supports simple query strings. - If your DAppnode is running a Gnosis Chain RPC endpoint, it is **strongly recommended** to use it here. + URL to the Blokli provider this HOPR node should use. - *Example:* `http://nethermind-xdai.dappnode:8545` + *Example:* `https://blokli.rotsee.hoprnet.link` secret: false # Regular expression for matching URLs with simple query strings # @@ -53,14 +52,7 @@ fields: # - (:[0-9]{2,5})? : Optional port number (10-99999) # Examples: :80, :8080, :44300 # - # - (/[a-z0-9.-/_]*)? : Optional URL path - # Allows: slashes, lowercase letters, numbers, dots, hyphens, underscores - # Examples: /path, /path/to/resource, /api/v1/endpoint - # - # - (\?[a-z0-9._=&-]*)? : Optional query string - # Allows: lowercase letters, numbers, dots, underscores, equals signs, ampersands, hyphens - # Examples: ?param=value, ?id=123&type=test, ?user.name=john_doe - pattern: ^http[s]{0,1}:\/\/[a-z0-9.-]{3,}(:[0-9]{2,5})?(\/[a-z0-9.-/_]*)?(\?[a-z0-9._=&-]*)?$ + pattern: ^http[s]{0,1}:\/\/[a-z0-9.-]{3,}(:[0-9]{2,5})?$ patternErrorMessage: Must be a valid url starting with `http://` or `https://` # - id: IDENTITY