-
Notifications
You must be signed in to change notification settings - Fork 10
feat: Adapt to v5 #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ausias-armesto
wants to merge
4
commits into
main
Choose a base branch
from
ausias/adapt-v5
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: Adapt to v5 #189
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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,65 @@ | ||
| name: Bump packages | ||
| on: | ||
| repository_dispatch: | ||
| types: [bump] | ||
| workflow_dispatch: | ||
| inputs: | ||
| hoprd_version: | ||
| description: 'Version of hoprd to build' | ||
| required: false | ||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| bump: | ||
| name: Bump docker images | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| 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.node.build.args.UPSTREAM_VERSION' docker-compose.yml) | ||
| default_hoprd_version=$(echo $default_hoprd_version | cut -d@ -f1) | ||
| hoprd_version="${HOPRD_VERSION:-$default_hoprd_version}" | ||
| docker pull "${DOCKER_REGISTRY}/hoprd:${hoprd_version#v}" | ||
| digest=$(docker inspect --format='{{index .RepoDigests 0}}' "${DOCKER_REGISTRY}/hoprd:${hoprd_version#v}" | cut -d@ -f2) | ||
| echo "HOPRD_VERSION=${hoprd_version}@${digest}" | tee -a "${GITHUB_OUTPUT}" | ||
|
|
||
| env: | ||
| DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY }} | ||
| HOPRD_VERSION: ${{ github.event.inputs.hoprd_version || github.event.client_payload.hoprd_version }} | ||
| - name: Update docker-compose.yml | ||
| run: | | ||
| yq -i '.services.node.build.args.UPSTREAM_VERSION = strenv(HOPRD_VERSION)' docker-compose.yml | ||
| env: | ||
| DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY }} | ||
| HOPRD_VERSION: ${{ steps.setup.outputs.HOPRD_VERSION }} | ||
| - name: Install dependencies | ||
| run: | | ||
| npm install | ||
| - name: Build | ||
| run: | | ||
| npx @dappnode/dappnodesdk build \ | ||
| --provider "remote" \ | ||
| --verbose | tee build.log | ||
| - name: Create Pull Request | ||
| uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 | ||
| with: | ||
| commit-message: "ci: Update docker images" | ||
| title: "ci: Update docker images" | ||
| body: "This pull request updates the docker images to:\n- hoprd: ${{ steps.setup.outputs.HOPRD_VERSION }}\n\nThis PR was automatically generated by the bump workflow." | ||
| branch: bot/update-${{ github.run_id}} | ||
| delete-branch: true | ||
| assignees: ${{ github.actor }} | ||
| reviewers: "ausias-armesto,tolbrino,NumberFour8,Teebor-Choka,QYuQianchen,jeandemeusy,majchrzamemil,Jaguaras,mjadach-iv" |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,41 @@ | ||
| name: Merge | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [closed] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| publish-ipfs: | ||
| name: Publish merged build to IPFS | ||
| if: github.event.pull_request.merged == true | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.pull_request.base.ref }} | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Set up Docker Compose | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y docker-compose | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build and upload to IPFS | ||
| run: | | ||
| npx @dappnode/dappnodesdk build \ | ||
| --provider "remote" \ | ||
| --verbose | tee build.log | ||
|
|
||
| ipfs_hash=$(grep -oP 'Release hash *: \K/ipfs/\w+' build.log) | ||
|
|
||
| echo "### DNP (DAppNode Package) built and uploaded" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "Merged build published to IPFS: \`${ipfs_hash}\`" >> "$GITHUB_STEP_SUMMARY" | ||
This file contains hidden or 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,63 @@ | ||
| name: PR | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, labeled] | ||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Test package | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Validate hoprd.cfg.yaml | ||
| run: ./test/validate-hoprd-config.sh | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Set up Docker Compose | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y docker-compose | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build package (validate manifest and compose file) | ||
| run: npx @dappnode/dappnodesdk build --skip_upload --verbose | ||
|
|
||
| publish-ipfs: | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| name: Publish test build to IPFS | ||
| needs: test | ||
| if: contains(github.event.pull_request.labels.*.name, 'publish-ipfs') | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Set up Docker Compose | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y docker-compose | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build and upload to IPFS | ||
| run: | | ||
| npx @dappnode/dappnodesdk build \ | ||
| --provider "remote" \ | ||
| --verbose | tee build.log | ||
|
|
||
| ipfs_hash=$(grep -oP 'Release hash *: \K/ipfs/\w+' build.log) | ||
|
|
||
| echo "### DNP (DAppNode Package) built and uploaded" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "Test build published to IPFS: \`${ipfs_hash}\`" >> "$GITHUB_STEP_SUMMARY" | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
This file contains hidden or 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,102 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| release_type: | ||
| description: Version type for this release | ||
| required: true | ||
| type: choice | ||
| default: "patch" | ||
| options: | ||
| - patch | ||
| - minor | ||
| - major | ||
|
|
||
| concurrency: | ||
| group: release | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| release: | ||
| name: Release | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| env: | ||
| # `secrets` isn't a valid context inside `if:` (only env/github/inputs/... are) - see | ||
| # the "Notify Zulip" step below, which needs these to decide whether to run at all. | ||
| ZULIP_EMAIL: ${{ secrets.ZULIP_EMAIL }} | ||
| ZULIP_API_KEY: ${{ secrets.ZULIP_API_KEY }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Set up Docker Compose | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y docker-compose | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Generate release notes | ||
| uses: hoprnet/hopr-workflows/actions/generate-release-notes@c20a995078b3a9a66ae9e6689d08d38ea37b5a0b # generate-release-notes-v1.0.1 | ||
| with: | ||
| source_branch: ${{ github.ref_name }} | ||
| format: github | ||
| release_notes_file: ./release-notes.md | ||
|
|
||
| - name: Add release notes to summary | ||
| run: | | ||
| echo "### Release notes" >> "$GITHUB_STEP_SUMMARY" | ||
| cat release-notes.md >> "$GITHUB_STEP_SUMMARY" | ||
|
|
||
| - name: Build and publish to package repository | ||
| id: publish | ||
| run: | | ||
| npx @dappnode/dappnodesdk publish "${{ inputs.release_type }}" \ | ||
| --provider "remote" \ | ||
| --upload_to "ipfs" \ | ||
| --verbose \ | ||
| --github_release | tee build.log | ||
|
|
||
| new_version=$(jq -r '.version' dappnode_package.json) | ||
| ipfs_hash=$(grep -oP 'Release hash *: \K/ipfs/\w+' build.log) | ||
|
|
||
| echo "### DNP (DAppNode Package) built and uploaded" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "- Version: \`${new_version}\`" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "- IPFS Hash: \`${ipfs_hash}\`" >> "$GITHUB_STEP_SUMMARY" | ||
|
|
||
| echo "new_version=$new_version" >> "$GITHUB_OUTPUT" | ||
| echo "ipfs_hash=$ipfs_hash" >> "$GITHUB_OUTPUT" | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| DEVELOPER_ADDRESS: "0x7305356ad936A06c4ea5DF45AD5E5C3ff9Db818E" | ||
|
|
||
| - name: Add release notes to the Github release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| tag="v${{ steps.publish.outputs.new_version }}" | ||
| gh release edit "$tag" --repo "${{ github.repository }}" --notes-file release-notes.md | ||
|
|
||
| - name: Notify Zulip | ||
| if: ${{ env.ZULIP_EMAIL != '' && env.ZULIP_API_KEY != '' }} | ||
| uses: zulip/github-actions-zulip/send-message@v1 | ||
| with: | ||
| api-key: ${{ env.ZULIP_API_KEY }} | ||
| email: ${{ env.ZULIP_EMAIL }} | ||
| organization-url: "https://hopr.zulipchat.com" | ||
| type: "stream" | ||
| to: HOPRd | ||
| topic: Releases | ||
| content: | | ||
| A new hoprd dAppNode package version v${{ steps.publish.outputs.new_version }} is available. | ||
| - IPFS Hash: ${{ steps.publish.outputs.ipfs_hash }} | ||
| Access your dAppNode and check for updates. |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -6,4 +6,6 @@ | |
| /.direnv | ||
|
|
||
| # Node.js | ||
| /node_modules/ | ||
| /node_modules/ | ||
|
|
||
| build.log | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.