From a3eefffb3a3925e1f71580f4f3585ca2f69459a4 Mon Sep 17 00:00:00 2001 From: ramil Date: Mon, 24 Aug 2020 18:51:26 +0300 Subject: [PATCH 1/7] CI: run build on PR and on push to master --- .github/workflows/build.yml | 12 ++++++++++++ .github/workflows/on-master.yaml | 25 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/on-master.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..57b4631b2 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,12 @@ +name: Docker Build + +on: [pull_request] + +jobs: + build: + name: Run docker-compose build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run docker build + run: docker build -t vulcanize/ethereum -f Dockerfile . diff --git a/.github/workflows/on-master.yaml b/.github/workflows/on-master.yaml new file mode 100644 index 000000000..23029fa04 --- /dev/null +++ b/.github/workflows/on-master.yaml @@ -0,0 +1,25 @@ +name: Docker Build and publish to Github + +on: + push: + branches: + - master + +jobs: + build: + name: Run docker build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Get the version + id: vars + run: echo ::set-output name=sha::$(echo ${GITHUB_SHA:0:7}) + - name: Run docker build + run: docker build -t vulcanize/ethereum -f Dockerfile . + - name: Tag docker image + run: docker tag vulcanize/ethereum docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} + - name: Docker Login + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://docker.pkg.github.com -u vulcanize --password-stdin + - name: Docker Push + run: docker push docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} + -- 2.45.2 From 8e62b50742d906b2a025446bfb0e34b0a7ae8e98 Mon Sep 17 00:00:00 2001 From: ramil Date: Mon, 24 Aug 2020 21:48:01 +0300 Subject: [PATCH 2/7] CI: debug building geth --- .github/workflows/build.yml | 21 ++++++++++++++++++++- .github/workflows/on-master.yaml | 2 +- .github/workflows/publish.yaml | 21 +++++++++++++++++++++ Dockerfile.amd64 | 7 +++++++ 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish.yaml create mode 100644 Dockerfile.amd64 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57b4631b2..ad95ebea8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,4 +9,23 @@ jobs: steps: - uses: actions/checkout@v2 - name: Run docker build - run: docker build -t vulcanize/ethereum -f Dockerfile . + run: docker build -t vulcanize/ethereum -f Dockerfile.amd64 . + - name: Get the version + id: vars + run: echo ::set-output name=sha::$(echo ${GITHUB_SHA:0:7}) + - name: Run docker build + run: docker build -t vulcanize/ethereum -f Dockerfile.amd64 . + - name: Tag docker image + run: docker tag vulcanize/ethereum docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} + - name: Docker Login + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://docker.pkg.github.com -u vulcanize --password-stdin + - name: Docker Push + run: docker push docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} + - name: Docker Pull + run: docker pull docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} + - name: Copy ethereum binary file + run: docker run --rm --entrypoint cat docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum /usr/local/bin/geth > geth-linux-amd64 + - uses: actions/upload-artifact@v2 + with: + name: my-artifact + path: geth-linux-amd64 \ No newline at end of file diff --git a/.github/workflows/on-master.yaml b/.github/workflows/on-master.yaml index 23029fa04..61e1101cc 100644 --- a/.github/workflows/on-master.yaml +++ b/.github/workflows/on-master.yaml @@ -15,7 +15,7 @@ jobs: id: vars run: echo ::set-output name=sha::$(echo ${GITHUB_SHA:0:7}) - name: Run docker build - run: docker build -t vulcanize/ethereum -f Dockerfile . + run: docker build -t vulcanize/ethereum -f Dockerfile.amd64 . - name: Tag docker image run: docker tag vulcanize/ethereum docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} - name: Docker Login diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 000000000..bfc218cb5 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,21 @@ +name: Publish Docker image +on: + release: + types: [published] +jobs: + push_to_registries: + name: Publish assets to Release + runs-on: ubuntu-latest + steps: + - name: Get the version + id: vars + run: | + echo ::set-output name=sha::$(echo ${GITHUB_SHA:0:7}) + echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/}) + - name: Docker Login to Github Registry + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://docker.pkg.github.com -u vulcanize --password-stdin + - name: Docker Pull + run: docker pull docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} + - name: Copy ethereum binary file + run: docker run --rm --entrypoint cat docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum /usr/local/bin/geth > geth-linux-amd64 + diff --git a/Dockerfile.amd64 b/Dockerfile.amd64 new file mode 100644 index 000000000..da78b77be --- /dev/null +++ b/Dockerfile.amd64 @@ -0,0 +1,7 @@ +# Build Geth in a stock Go builder container +FROM golang:1.13 as builder + +#RUN apk add --no-cache make gcc musl-dev linux-headers git + +ADD . /go-ethereum +RUN cd /go-ethereum && make geth -- 2.45.2 From b0e55565c0650324d00c88265716bd06417a7348 Mon Sep 17 00:00:00 2001 From: ramil Date: Mon, 24 Aug 2020 22:42:06 +0300 Subject: [PATCH 3/7] CI: fix coping file --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad95ebea8..4755816ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: - name: Docker Pull run: docker pull docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} - name: Copy ethereum binary file - run: docker run --rm --entrypoint cat docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum /usr/local/bin/geth > geth-linux-amd64 + run: docker run --rm --entrypoint cat docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} /usr/local/bin/geth > geth-linux-amd64 - uses: actions/upload-artifact@v2 with: name: my-artifact -- 2.45.2 From bf2faa303882d0f8a45c6c92b571dbad79934f48 Mon Sep 17 00:00:00 2001 From: ramil Date: Mon, 24 Aug 2020 22:50:47 +0300 Subject: [PATCH 4/7] CI: fix coping file v2 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4755816ff..b43c2fb0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: - name: Docker Pull run: docker pull docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} - name: Copy ethereum binary file - run: docker run --rm --entrypoint cat docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} /usr/local/bin/geth > geth-linux-amd64 + run: docker run --rm --entrypoint cat docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} /go-ethereum/build/bin/geth > geth-linux-amd64 - uses: actions/upload-artifact@v2 with: name: my-artifact -- 2.45.2 From 1c0ef578d5316164c2453ed364345ca919794c7e Mon Sep 17 00:00:00 2001 From: ramil Date: Mon, 24 Aug 2020 23:04:36 +0300 Subject: [PATCH 5/7] CI: temporary upload file to release asset --- .github/workflows/build.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b43c2fb0f..323acb413 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,4 +28,14 @@ jobs: - uses: actions/upload-artifact@v2 with: name: my-artifact - path: geth-linux-amd64 \ No newline at end of file + path: geth-linux-amd64 + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: https://uploads.github.com/repos/vulcanize/go-ethereum/releases/18994686/assets{?name,label} + asset_path: geth-linux-amd64 + asset_name: geth-linux-amd64 + asset_content_type: application/octet-stream \ No newline at end of file -- 2.45.2 From 77614a1bc18ad6664c2e9a916d02f646c152da5a Mon Sep 17 00:00:00 2001 From: ramil Date: Mon, 24 Aug 2020 23:23:33 +0300 Subject: [PATCH 6/7] CI: get release upload_url by tag, upload asset to current relase --- .github/workflows/build.yml | 31 +------------------------------ .github/workflows/on-master.yaml | 6 +++--- .github/workflows/publish.yaml | 19 +++++++++++++++---- 3 files changed, 19 insertions(+), 37 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 323acb413..1c59232a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,38 +4,9 @@ on: [pull_request] jobs: build: - name: Run docker-compose build + name: Run docker build runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Run docker build run: docker build -t vulcanize/ethereum -f Dockerfile.amd64 . - - name: Get the version - id: vars - run: echo ::set-output name=sha::$(echo ${GITHUB_SHA:0:7}) - - name: Run docker build - run: docker build -t vulcanize/ethereum -f Dockerfile.amd64 . - - name: Tag docker image - run: docker tag vulcanize/ethereum docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} - - name: Docker Login - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://docker.pkg.github.com -u vulcanize --password-stdin - - name: Docker Push - run: docker push docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} - - name: Docker Pull - run: docker pull docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} - - name: Copy ethereum binary file - run: docker run --rm --entrypoint cat docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} /go-ethereum/build/bin/geth > geth-linux-amd64 - - uses: actions/upload-artifact@v2 - with: - name: my-artifact - path: geth-linux-amd64 - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: https://uploads.github.com/repos/vulcanize/go-ethereum/releases/18994686/assets{?name,label} - asset_path: geth-linux-amd64 - asset_name: geth-linux-amd64 - asset_content_type: application/octet-stream \ No newline at end of file diff --git a/.github/workflows/on-master.yaml b/.github/workflows/on-master.yaml index 61e1101cc..13a7b52d0 100644 --- a/.github/workflows/on-master.yaml +++ b/.github/workflows/on-master.yaml @@ -7,15 +7,15 @@ on: jobs: build: - name: Run docker build + name: Run docker build and publish runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Run docker build + run: docker build -t vulcanize/ethereum -f Dockerfile.amd64 . - name: Get the version id: vars run: echo ::set-output name=sha::$(echo ${GITHUB_SHA:0:7}) - - name: Run docker build - run: docker build -t vulcanize/ethereum -f Dockerfile.amd64 . - name: Tag docker image run: docker tag vulcanize/ethereum docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} - name: Docker Login diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index bfc218cb5..014c21276 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,4 +1,4 @@ -name: Publish Docker image +name: Publish geth to release on: release: types: [published] @@ -11,11 +11,22 @@ jobs: id: vars run: | echo ::set-output name=sha::$(echo ${GITHUB_SHA:0:7}) - echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/}) - name: Docker Login to Github Registry run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://docker.pkg.github.com -u vulcanize --password-stdin - name: Docker Pull run: docker pull docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} - name: Copy ethereum binary file - run: docker run --rm --entrypoint cat docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum /usr/local/bin/geth > geth-linux-amd64 - + run: docker run --rm --entrypoint cat docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} /go-ethereum/build/bin/geth > geth-linux-amd64 + - name: Get release + id: get_release + uses: bruceadams/get-release@v1.2.0 + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: geth-linux-amd64 + asset_name: geth-linux-amd64 + asset_content_type: application/octet-stream -- 2.45.2 From bab82402a738308e14b284fa82babaedcd656bb6 Mon Sep 17 00:00:00 2001 From: ramil Date: Mon, 24 Aug 2020 23:37:30 +0300 Subject: [PATCH 7/7] CI: fix tag name --- .github/workflows/build.yml | 2 +- .github/workflows/on-master.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c59232a3..8eb113c34 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,4 +9,4 @@ jobs: steps: - uses: actions/checkout@v2 - name: Run docker build - run: docker build -t vulcanize/ethereum -f Dockerfile.amd64 . + run: docker build -t vulcanize/go-ethereum -f Dockerfile.amd64 . diff --git a/.github/workflows/on-master.yaml b/.github/workflows/on-master.yaml index 13a7b52d0..9c0c8f89d 100644 --- a/.github/workflows/on-master.yaml +++ b/.github/workflows/on-master.yaml @@ -12,12 +12,12 @@ jobs: steps: - uses: actions/checkout@v2 - name: Run docker build - run: docker build -t vulcanize/ethereum -f Dockerfile.amd64 . + run: docker build -t vulcanize/go-ethereum -f Dockerfile.amd64 . - name: Get the version id: vars run: echo ::set-output name=sha::$(echo ${GITHUB_SHA:0:7}) - name: Tag docker image - run: docker tag vulcanize/ethereum docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} + run: docker tag vulcanize/go-ethereum docker.pkg.github.com/vulcanize/go-ethereum/go-ethereum:${{steps.vars.outputs.sha}} - name: Docker Login run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://docker.pkg.github.com -u vulcanize --password-stdin - name: Docker Push -- 2.45.2