-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from NoSkillGuy/feat/build-cli
[WIP] Feat/build cli
- Loading branch information
Showing
2 changed files
with
139 additions
and
54 deletions.
There are no files selected for viewing
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
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 |
This file was deleted.
Oops, something went wrong.