Skip to content

Commit f3d72cc

Browse files
committed
fix: build release from manifest version to avoid APM version mismatch
The publish command derives the next version from the on-chain APM registry, which is still at 0.0.1. This caused every release to be built as 0.0.2 even though the manifest says 0.1.1. Switch the release job to dappnodesdk build (uses the manifest version as-is) and create the GitHub pre-release with gh. The resulting package reports version 0.1.1 and gets a fresh IPFS hash. The on-chain APM update remains a manual follow-up for the repo owner.
1 parent 4930ec3 commit f3d72cc

1 file changed

Lines changed: 48 additions & 5 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- "v[0-9]+.[0-9]+.[0-9]+"
99
paths-ignore:
1010
- "README.md"
11-
workflow_dispatch:
11+
workflow_dispatch:
1212

1313
jobs:
1414
build-test:
@@ -25,8 +25,51 @@ jobs:
2525
if: github.event_name == 'push'
2626
steps:
2727
- uses: actions/checkout@v6
28-
- name: Publish
29-
run: npx @dappnode/dappnodesdk publish patch --dappnode_team_preset
28+
29+
- name: Build package from manifest version
30+
id: build
31+
run: |
32+
npx @dappnode/dappnodesdk build \
33+
--provider https://api.ipfs.dappnode.io \
34+
--upload_to ipfs \
35+
--verbose
36+
version=$(jq -r .version dappnode_package.json)
37+
hash=$(jq -r --arg v "$version" '.[$v].hash' releases.json)
38+
dnp_name=$(jq -r .name dappnode_package.json)
39+
echo "version=$version" >> "$GITHUB_OUTPUT"
40+
echo "hash=$hash" >> "$GITHUB_OUTPUT"
41+
echo "release_dir=build_${dnp_name}_${version}" >> "$GITHUB_OUTPUT"
42+
43+
- name: Create GitHub pre-release
44+
run: |
45+
version="${{ steps.build.outputs.version }}"
46+
hash="${{ steps.build.outputs.hash }}"
47+
release_dir="${{ steps.build.outputs.release_dir }}"
48+
tag="v${version}-${{ github.run_number }}"
49+
50+
encoded_hash=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$hash', safe=''))")
51+
install_link="http://my.dappnode/installer/public/${encoded_hash}"
52+
publish_link="https://dappnode.github.io/sdk-publish/?r=nextcloud.public.dappnode.eth&v=${version}&h=${encoded_hash}"
53+
54+
printf '%s\n' "$hash" > "${release_dir}/content-hash"
55+
56+
cat > release_body.md <<EOF
57+
## Package versions
58+
59+
Package | Version | Hash | Install | Publish
60+
--- | --- | --- | --- | ---
61+
Nextcloud | ${version} | \`${hash}\` | [:inbox_tray:](${install_link}) | [:mega:](${publish_link})
62+
EOF
63+
64+
mapfile -d '' assets < <(find "$release_dir" -maxdepth 1 -type f \
65+
\( -name '*.yml' -o -name '*.yaml' -o -name '*.txz' -o -name 'dappnode_package.json' -o -name 'content-hash' -o -name '*.png' \) \
66+
-print0)
67+
68+
gh release create "$tag" \
69+
--prerelease \
70+
--generate-notes \
71+
--notes-file release_body.md \
72+
--target "$GITHUB_SHA" \
73+
"${assets[@]}"
3074
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
DEVELOPER_ADDRESS: "0xB22981bA3FE1De2325935c91a3B717168fB86714"
75+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)