Skip to content

Commit

Permalink
Merge pull request #10 from zenchainprotocol/Fix_Version
Browse files Browse the repository at this point in the history
Fix version
  • Loading branch information
ZenChainDev committed Apr 16, 2021
2 parents f08947a + d242d29 commit f2d886f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 43 deletions.
50 changes: 34 additions & 16 deletions .github/workflows/build.yml
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.

0 comments on commit f2d886f

Please sign in to comment.