Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix version #10

Merged
merged 14 commits into from
Apr 16, 2021
50 changes: 34 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,59 @@ on:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10


# This workflow makes x86_64 binaries for mac, windows, and linux.

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm64]
arch: [amd64]
targetos: [windows, darwin, linux]
name: zenchain ${{ matrix.arch }} for ${{ matrix.targetos }}
steps:
- uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v1
with:
go-version: 1.15
go-version: 1.16
env:
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}

- name: Compile
- name: Setup version
id: get_version
run:
echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)

- name: Setup git commit
id: get_commit
run:
echo ::set-output name=COMMIT::$(echo $GITHUB_SHA)
- name: Compile ${{ matrix.arch }} for ${{ matrix.targetos }}
env:
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}
run: |
go mod download
cd cmd/zenchaind
go build -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=zenchain \
-X github.com/cosmos/cosmos-sdk/version.AppName=zenchaind \
-X github.com/cosmos/cosmos-sdk/version.Version=$(echo $GITHUB_REF | cut -d / -f 3)\
-X github.com/cosmos/cosmos-sdk/version.Commit=$GITHUB_SHA' \
-o build/zenchaind ./cmd/zenchaind

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
echo ${{ steps.get_version.outputs.VERSION }}
echo ${{ steps.get_commit.outputs.COMMIT }}
go build -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=ZenChain -X github.com/cosmos/cosmos-sdk/version.AppName=zenchaind -X github.com/cosmos/cosmos-sdk/version.Version=${{ steps.get_version.outputs.VERSION }} -X github.com/cosmos/cosmos-sdk/version.Commit=${{ steps.get_commit.outputs.COMMIT }}' -o build-${{ matrix.targetos }}-${{ matrix.arch }}/ .
zip -r build-${{ matrix.targetos }}-${{ matrix.arch }}.zip build-${{ matrix.targetos }}-${{ matrix.arch }}
# - uses: actions/upload-artifact@v2
# with:
# name: zenchaind ${{ matrix.targetos }} ${{ matrix.arch }}
# path: cmd/zenchaind/zenchaind.zip
- name: Push to Lauchpad repo
uses: zenchainprotocol/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/zenchaind
asset_name: zenchaind ${{ matrix.targetos }} ${{ matrix.arch }}
tag: ${{ github.ref }}

source_file: cmd/zenchaind/build-${{ matrix.targetos }}-${{ matrix.arch }}.zip
destination_repo: zenchainprotocol/Launchpad
destination_folder: build/${{ steps.get_version.outputs.VERSION }}/
user_email: 'zenchain102@gmail.com'
user_name: 'ZenChainDev'
commit_message: ${{ steps.get_version.outputs.VERSION }} - Publish buid ${{ matrix.targetos }} ${{ matrix.arch }}
27 changes: 0 additions & 27 deletions .github/workflows/tag.yml

This file was deleted.