Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
viteshan authored Sep 2, 2021
1 parent 16fca30 commit a07172c
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: gvite-nightly-build

on:
workflow_dispatch:
inputs:
branch:
description: 'nightly build from'
required: true
tag:
description: 'tag'
required: true

jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
repository: 'vitelabs/go-vite'
ref: '${{ github.event.inputs.branch }}'

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Test
run: make test

- name: Get Build Version
id: version
run: echo "::set-output name=version::$(date +%Y%m%d%H%M)"

- name: Build
run: echo "${{ github.event.inputs.tag }}-nightly-${{ steps.version.outputs.version }}" > 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.branch }}-nightly-${{ steps.version.outputs.version }}"
artifacts: "build/cmd/gvite/*.tar.gz"
bodyFile: "build/cmd/gvite/release.sha256.log"
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a07172c

Please sign in to comment.