From a05b33af96a8618ddf9f9e5d14a13c61046521b8 Mon Sep 17 00:00:00 2001 From: 3alpha <15694175+3alpha@users.noreply.github.com> Date: Fri, 10 Jul 2026 10:47:01 +0200 Subject: [PATCH] ci: use dappnode-build-hash reusable workflow Replaces the inlined build-test (which used `--skip_save` and never posted an IPFS hash on PRs) with a thin caller for the new `dappnode/workflows/.github/workflows/dappnode-build-hash.yml@master` reusable workflow. `build.yml` (new) handles push (non-default branch) and workflow_dispatch; `main.yml` is reduced to the release job only. Also: - Upgrades `actions/checkout` to v7 and adds Node 24 setup (`actions/setup-node@v6`) for the release job. - Drops the redundant `if:` condition on the release job. - Adds `repository_dispatch` to the `on:` triggers. - Removes the now-unused `PINATA_API_KEY` / `PINATA_SECRET_API_KEY` from the release job (only `build.yml` needs them). - Removes the stale `master` branch from `on.push.branches` (NEAR's default branch is `main`). - Removes the `pull_request` trigger from `main.yml` (now in build.yml). - Adds `branches-ignore: ["main"]` to `build.yml`'s push trigger so the workflow doesn't run on default-branch pushes (the SDK already auto-detects and does a no-op test build in that case). The reusable workflow auto-detects the event: on push to a non-default branch it builds, pins to Pinata, and posts a comment authored by tropibot[bot] on the PR; on push to the default branch it does a test build only. --- .github/workflows/build.yml | 13 +++++++++++++ .github/workflows/main.yml | 24 ++++++------------------ 2 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..4d90e23 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,13 @@ +name: Build + +on: + workflow_dispatch: + push: + branches-ignore: + - "main" + paths-ignore: ["README.md"] + +jobs: + build: + uses: dappnode/workflows/.github/workflows/dappnode-build-hash.yml@master + secrets: inherit diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 751efdd..d620c7c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,37 +1,25 @@ name: "Main" on: - pull_request: push: branches: - - "master" - "main" - "v[0-9]+.[0-9]+.[0-9]+" paths-ignore: - "README.md" + workflow_dispatch: + repository_dispatch: jobs: - build-test: - runs-on: ubuntu-latest - name: Build test - if: github.event_name != 'push' - steps: - - uses: actions/checkout@v6 - - run: npx @dappnode/dappnodesdk build --provider remote - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PINATA_API_KEY: ${{ secrets.PINATA_API_KEY }} - PINATA_SECRET_API_KEY: ${{ secrets.PINATA_SECRET_API_KEY }} - release: name: Release runs-on: ubuntu-latest - if: github.event_name == 'push' steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 + - uses: actions/setup-node@v6 + with: + node-version: "24" - name: Publish run: npx @dappnode/dappnodesdk publish patch --dappnode_team_preset env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PINATA_API_KEY: ${{ secrets.PINATA_API_KEY }} - PINATA_SECRET_API_KEY: ${{ secrets.PINATA_SECRET_API_KEY }} DEVELOPER_ADDRESS: "0xf35960302a07022aba880dffaec2fdd64d5bf1c1"