gvite-release-build #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: gvite-release-build | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: "release from" | |
required: true | |
tag: | |
description: "release tag" | |
required: true | |
jobs: | |
build: | |
runs-on: ubuntu-18.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: "${{ github.event.inputs.branch }}" | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.16 | |
- name: Release Version && Commit | |
run: echo "${{ github.event.inputs.tag }}" > version/buildversion ; make build_version | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v7 | |
with: | |
branch: ${{ github.event.inputs.branch }} | |
message: "release ${{ github.event.inputs.tag }}" | |
add: "version" | |
- name: Build | |
run: echo "${{ github.event.inputs.tag }}" > version/buildversion ; make all | |
- name: Release Log | |
run: cd build/cmd/gvite ;ls | grep -v ".tar.gz" | while read line; do tar zcvf $line.tar.gz $line ; openssl dgst -sha256 $line.tar.gz >> release.sha256.log ;done ; cd ../../../ | |
- name: Release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: "${{ github.event.inputs.tag }}" | |
commit: "${{ github.event.inputs.branch }}" | |
artifacts: "build/cmd/gvite/*.tar.gz" | |
bodyFile: "build/cmd/gvite/release.sha256.log" | |
prerelease: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Set up Docker QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Available Docker platforms | |
run: echo ${{ steps.buildx.outputs.platforms }} | |
- name: Push to Docker Hub | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
context: . | |
file: docker/Dockerfile | |
platforms: linux/amd64, linux/arm64 | |
tags: vitelabs/gvite:${{ github.event.inputs.tag }},vitelabs/gvite:latest |