Skip to content

Commit

Permalink
Merge pull request #31 from NoSkillGuy/feat/build-cli
Browse files Browse the repository at this point in the history
[WIP] Feat/build cli
  • Loading branch information
cnlangzi authored Aug 10, 2021
2 parents 9e3dc54 + f829cef commit 35d51aa
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 54 deletions.
139 changes: 139 additions & 0 deletions .github/workflows/build-cli.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: build-cli
on:
push:
branches:
- master
- dev
- feat/build-cli
tags:
- 'v*.*.*'

pull_request:
branches:
- master
- production
jobs:
build-linux:
name: Build-linux
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v2

- name: Set GITHUB_ENV
run: |
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
if [[ "${{github.base_ref}}" == "master" || "${{github.ref}}" == "refs/heads/master" ]]; then
echo "TAG=v0.0.0-master" >> $GITHUB_ENV
elif [[ "${{github.base_ref}}" == "dev" || "${{github.ref}}" == "refs/heads/dev" ]]; then
echo "TAG=v0.0.0-dev" >> $GITHUB_ENV
else
echo "TAG=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g' )" >> $GITHUB_ENV
fi
- name: Install
run: make install

- name: zip release
run: tar -czvf zwallet-linux.tar.gz ./zwallet

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: zwallet-linux.tar.gz
tag: ${{ env.TAG }}
overwrite: true
file_glob: true

- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
with:
name: zwallet-linux
path: zwallet
retention-days: 5
build-windows:
name: Build-windows
runs-on: windows-latest
steps:

- name: Checkout
uses: actions/checkout@v2

- name: Set GITHUB_ENV
run: |
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
if [[ "${{github.base_ref}}" == "master" || "${{github.ref}}" == "refs/heads/master" ]]; then
echo "TAG=v0.0.0-master" >> $GITHUB_ENV
elif [[ "${{github.base_ref}}" == "dev" || "${{github.ref}}" == "refs/heads/dev" ]]; then
echo "TAG=v0.0.0-dev" >> $GITHUB_ENV
else
echo "TAG=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g' )" >> $GITHUB_ENV
fi
- name: Install
run: make install

- name: zip release
run: |
copy zwallet zwallet.exe
7z a zwallet-windows.zip zwallet.exe
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: zwallet-windows.zip
tag: ${{ env.TAG }}
overwrite: true
file_glob: true

- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
with:
name: zwallet-windows
path: zwallet
retention-days: 5
build-macos:
name: Build-macos
runs-on: macos-latest
steps:

- name: Checkout
uses: actions/checkout@v2

- name: Set GITHUB_ENV
run: |
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
if [[ "${{github.base_ref}}" == "master" || "${{github.ref}}" == "refs/heads/master" ]]; then
echo "TAG=v0.0.0-master" >> $GITHUB_ENV
elif [[ "${{github.base_ref}}" == "dev" || "${{github.ref}}" == "refs/heads/dev" ]]; then
echo "TAG=v0.0.0-dev" >> $GITHUB_ENV
else
echo "TAG=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g' )" >> $GITHUB_ENV
fi
- name: Install
run: make install
- name: zip release
run: tar -czvf zwallet-macos.tar.gz ./zwallet

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: zwallet-macos.tar.gz
tag: ${{ env.TAG }}
overwrite: true
file_glob: true

- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
with:
name: zwallet-macos
path: zwallet
retention-days: 5
54 changes: 0 additions & 54 deletions .github/workflows/build.yaml

This file was deleted.

0 comments on commit 35d51aa

Please sign in to comment.