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