CI: get release upload_url by tag, upload asset to current relase
This commit is contained in:
parent
1c0ef578d5
commit
77614a1bc1
31
.github/workflows/build.yml
vendored
31
.github/workflows/build.yml
vendored
@ -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
|
6
.github/workflows/on-master.yaml
vendored
6
.github/workflows/on-master.yaml
vendored
@ -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
|
||||
|
19
.github/workflows/publish.yaml
vendored
19
.github/workflows/publish.yaml
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user