Skip to content

Merge pull request #37 from ironbeer/dev-v1.2.0 #28

Merge pull request #37 from ironbeer/dev-v1.2.0

Merge pull request #37 from ironbeer/dev-v1.2.0 #28

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
jobs:
build:
name: Build
strategy:
matrix:
os: [linux]
arch: [amd64, arm64]
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
submodules: true
- name: Build Binary - ${{ matrix.os }} ${{ matrix.arch }}
if: matrix.arch == 'amd64'
run: |
docker run --rm -t \
-v ${{ github.workspace }}:${{ github.workspace }} \
-w ${{ github.workspace }} \
-e GOOS=${{ matrix.os }} \
-e GOARCH=${{ matrix.arch }} \
golang:1.17.8-buster make geth
- name: Build Binary - ${{ matrix.os }} ${{ matrix.arch }}
if: matrix.arch == 'arm64'
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm -t \
-v ${{ github.workspace }}:${{ github.workspace }} \
-w ${{ github.workspace }} \
-e GOOS=${{ matrix.os }} \
-e GOARCH=${{ matrix.arch }} \
arm64v8/golang:1.17.8-buster make geth
- name: Check version label
if: matrix.arch == 'amd64'
run: './build/bin/geth version | grep -q "Version: $(echo ${{ github.ref_name }} | cut -c 2-10)"'
- name: Compress Binary
run: zip -j geth-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.arch }}.zip ./build/bin/geth
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: ${{ github.ref_name }}
path: geth-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.arch }}.zip
release:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Download Artifact
uses: actions/download-artifact@v2
with:
name: ${{ github.ref_name }}
path: artifacts
- name: Archive genesis.json
run: zip -r genesis.zip genesis
- name: Create setup.sh
run: |
sed -e 's#__REPOSITORY__#${{ github.repository }}#' .github/setup_template.sh | \
sed -e 's#__RELEASE__#${{ github.ref_name }}#' > setup.sh
- name: Create sha256sums.txt
run: |
sha256sum genesis.zip > sha256sums.txt
sha256sum setup.sh >> sha256sums.txt
(cd artifacts && sha256sum *) >> sha256sums.txt
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: true
- name: Upload Asset - Linux amd64
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/geth-${{ github.ref_name }}-linux-amd64.zip
asset_name: geth-${{ github.ref_name }}-linux-amd64.zip
asset_content_type: application/zip
- name: Upload Asset - Linux arm64
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/geth-${{ github.ref_name }}-linux-arm64.zip
asset_name: geth-${{ github.ref_name }}-linux-arm64.zip
asset_content_type: application/zip
- name: Upload Asset - genesis.zip
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: genesis.zip
asset_name: genesis.zip
asset_content_type: application/zip
- name: Upload Asset - setup.sh
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: setup.sh
asset_name: setup.sh
asset_content_type: text/plain
- name: Upload Asset - sha256sums.txt
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: sha256sums.txt
asset_name: sha256sums.txt
asset_content_type: text/plain