Skip to content
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

v0.1.11 Release #11

Merged
merged 7 commits into from
Oct 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/auto_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Update DAppNode package
on:
schedule:
# * is a special character in YAML so you have to quote this string
# - cron: '00 */4 * * *'
- cron: '* * * * *'
- cron: '00 */12 * * *'
jobs:
dappnodepackage-update:
Expand All @@ -12,15 +14,17 @@ jobs:
DISPATCH_REPO: dappnode/DAppNodePackage-geth
UPSTREAM_REPO: ethereum/go-ethereum
steps:
- uses: actions/checkout@v2
- name: Get the tag
id: get_tag
run: |
UPSTREAM_TAG=$(curl https://api.github.com/repos/$UPSTREAM_REPO/releases/latest | jq .tag_name | tr -d "\"" )
DNP_TAG=$(curl https://api.github.com/repos/$DISPATCH_REPO/releases/tags/$UPSTREAM_TAG | jq .tag_name | tr -d "\"" )
if [ $UPSTREAM_TAG != $DNP_TAG ];then
UPSTREAM_TAG=$(curl https://api.github.com/repos/$UPSTREAM_REPO/tags | jq .[0].name | tr -d "\"" )
DNP_UPSTREAM=$(cat dappnode_package.json | jq .upstreamVersion | tr -d "\"" )
if [ $UPSTREAM_TAG != $DNP_UPSTREAM ];then
echo "::set-output name=trigger_update::true"
fi
echo ::set-output name=TAG::$UPSTREAM_TAG

- name: Send dispatch event to the DAppNode Package repository
if: steps.get_tag.outputs.trigger_update == 'true'
run: |
Expand Down
135 changes: 24 additions & 111 deletions .github/workflows/dispatch_release.yml
Original file line number Diff line number Diff line change
@@ -1,123 +1,36 @@
name: Remote Dispatch Action Initiator

name: "Main"
on:
repository_dispatch:
pull_request:
push:
branches:
- "master"
- "v[0-9]+.[0-9]+.[0-9]+"
paths-ignore:
- "README.md"

jobs:
new_version:
build-test:
runs-on: ubuntu-16.04
name: Build test
if: github.event_name != 'push'
steps:
- name: Checkout
uses: actions/checkout@v2
- run: docker-compose build

release:
name: Release
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'repository_dispatch'
steps:
- uses: actions/checkout@v2
- name: New remote repository event
id: dispatch-event
run: |
echo "Event '${{ github.event.action }}' with tag: '${{ github.event.client_payload.tag }}'"
echo "::set-output name=TAG::${{ github.event.client_payload.tag }}"
echo UPSTREAM_VERSION=${{ github.event.client_payload.tag }} > .env

- name: Setup nodejs
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: "10.x"

- name: dappnodesdk install
run: npm install -g @dappnode/dappnodesdk

- name: Get next DAppNodePackage release
id: next-release
run: echo "::set-output name=DNP_VERSION::$(dappnodesdk next patch -p remote)"

- name: Check and delete if a release already exists
- name: Publish
run: npx @dappnode/dappnodesdk publish patch --dappnode_team_preset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE_ID=$(curl https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ steps.dispatch-event.outputs.TAG }} | jq .id || echo "")
PRE_RELEASE=$(curl -s https://api.github.com/repos/dappnode/${{ github.repository }}releases/tags/${{ steps.dispatch-event.outputs.TAG }} | jq .prerelease)
if [ $PRE_RELEASE == "false" ];then
exit 1
elif [ ! -z "$RELEASE_ID" ];then
curl -H "Authorization: token ${GITHUB_TOKEN}" -X DELETE https://api.github.com/repos/${{ github.repository }}/releases/${RELEASE_ID}
fi

- name: Docker-Compose Build
run: |
docker-compose build

- name: dappnodesdk publish
id: dappnodesdk-publish
run: |
sed -i "s/upstreamVersion\":.*,/upstreamVersion\": \"${{ steps.dispatch-event.outputs.TAG }}\",/g" dappnode_package.json
dappnodesdk publish patch -p remote
echo "::set-output name=CONTENT_HASH::$(cat ./build_${{ steps.next-release.outputs.DNP_VERSION }}/content-hash | sed 's/\//%2F/g')"
echo "::set-output name=PACKAGE_NAME::$(cat dappnode_package.json | jq .name | tr -d "\"")"

- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
release_name: v${{ steps.next-release.outputs.DNP_VERSION }}
tag_name: ${{ steps.dispatch-event.outputs.TAG }}
body: |
# ${{ steps.dispatch-event.outputs.TAG }}
You can execute a transaction to publish this package from the Admin UI with Metamask by following this pre-filled [link](http://my.dappnode/#/sdk/publish/r=${{ steps.dappnodesdk-publish.outputs.PACKAGE_NAME }}&v=${{ steps.next-release.outputs.DNP_VERSION }}&h=${{ steps.dappnodesdk-publish.outputs.CONTENT_HASH }})
draft: false
prerelease: true

- name: Upload release .xz file
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./build_${{ steps.next-release.outputs.DNP_VERSION }}/${{ steps.dappnodesdk-publish.outputs.PACKAGE_NAME }}_${{ steps.next-release.outputs.DNP_VERSION }}.tar.xz
asset_name: ${{ steps.dappnodesdk-publish.outputs.PACKAGE_NAME }}_${{ steps.next-release.outputs.DNP_VERSION }}.tar.xz
asset_content_type: "application/octet-stream"

- name: Upload release avatar file
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./build_${{ steps.next-release.outputs.DNP_VERSION }}/avatar.png
asset_name: avatar.png
asset_content_type: "application/octet-stream"

- name: Upload release dappnode_package.json file
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./build_${{ steps.next-release.outputs.DNP_VERSION }}/dappnode_package.json
asset_name: dappnode_package.json
asset_content_type: "application/octet-stream"

- name: Upload release docker-compose.yml file
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./build_${{ steps.next-release.outputs.DNP_VERSION }}/docker-compose.yml
asset_name: docker-compose.yml
asset_content_type: "application/octet-stream"

- name: Upload release content-hash file
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./build_${{ steps.next-release.outputs.DNP_VERSION }}/content-hash
asset_name: content-hash
asset_content_type: "application/octet-stream"

- name: Commit changes
run: |
git config --global user.email "eduadiez@gmail.com"
git config --global user.name "Eduardo"
git commit -am "Github action update"
git push
DEVELOPER_ADDRESS: "0xf35960302a07022aba880dffaec2fdd64d5bf1c1"
9 changes: 8 additions & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@ RUN apk add --no-cache make gcc musl-dev linux-headers git && \


FROM alpine:edge
RUN apk add --no-cache make gcc musl-dev linux-headers git && \
git clone -b ${UPSTREAM_VERSION} https://github.com/ethereum/go-ethereum.git && \
cd go-ethereum && make geth

RUN apk --no-cache add \
libstdc++ eudev-libs libgcc bash

# Pull Geth into a second stage deploy alpine container
FROM alpine:latest

RUN apk add --no-cache ca-certificates

COPY --from=builder /go/go-ethereum/build/bin/geth /usr/local/bin

ENV SYNCMODE fast
ENTRYPOINT geth --rpc --rpcaddr 0.0.0.0 --rpccorsdomain "*" --rpcvhosts "*" --ws --wsorigins "*" --wsaddr 0.0.0.0 --syncmode ${SYNCMODE:-fast} --nousb $EXTRA_OPTS
11 changes: 9 additions & 2 deletions dappnode_package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"name": "geth.dnp.dappnode.eth",
"version": "0.1.9",
"upstreamVersion": "v1.9.15",
"upstreamVersion": "v1.9.21",
"shortDescription": "Geth is the official Go implementation of the Ethereum protocol.",
"description": "Ethereum is a global, open-source platform for decentralized applications where you can write code that controls digital value, runs exactly as programmed, and is accessible anywhere in the world.",
"type": "library",
"architectures": ["linux/amd64", "linux/arm64"],
"architectures": [
"linux/amd64",
"linux/arm64"
],
"chain": "ethereum",
"author": "DAppNode Association <admin@dappnode.io> (https://github.com/dappnode)",
"contributors": [
Expand All @@ -16,6 +19,10 @@
"Blockchain"
],
"license": "GLP-3.0",
"architectures": [
"linux/amd64",
"linux/arm64"
],
"links": {
"endpoint": "http://geth.dappnode:8545",
"homepage": "https://github.com/dappnode/DAppNodePackage-geth#readme"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.4'
services:
geth.dnp.dappnode.eth:
image: 'geth.dnp.dappnode.eth:0.1.9'
image: 'geth.dnp.dappnode.eth:0.1.11'
build:
context: ./build
args:
Expand Down