Skip to content

Commit

Permalink
add build-windows in release-wallet.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
boddumanohar committed Oct 20, 2023
1 parent 20d35c7 commit 9805a7b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 62 deletions.
52 changes: 1 addition & 51 deletions .github/workflows/build-zwallet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- sprint*
tags:
- 'v*.*.*'
pull_request:

jobs:
build-linux:
Expand All @@ -26,35 +27,9 @@ jobs:
- 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
elif [[ "${{github.base_ref}}" == "staging" || "${{github.ref}}" == "refs/heads/staging" ]]; then
echo "TAG=v0.0.0-staging" >> $GITHUB_ENV
else
echo "TAG=$(echo ${GITHUB_REF#refs/tags/})" >> $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:
Expand Down Expand Up @@ -128,33 +103,8 @@ jobs:
- 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
elif [[ "${{github.base_ref}}" == "staging" || "${{github.ref}}" == "refs/heads/staging" ]]; then
echo "TAG=v0.0.0-staging" >> $GITHUB_ENV
else
echo "TAG=$(echo ${GITHUB_REF#refs/tags/})" >> $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
Expand Down
50 changes: 39 additions & 11 deletions .github/workflows/release-zwalletcli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,32 +98,60 @@ jobs:
retention-days: 5

build-windows:
name: Build-Windows
name: Build-windows
runs-on: windows-runner

defaults:
run:
shell: msys2 {0}
strategy:
matrix:
sys: [ MINGW64 ]
steps:
- name: Setup go
uses: actions/setup-go@v3
- uses: msys2/setup-msys2@v2
with:
go-version: ^1.20.0 # The Go version to download (if necessary) and use.
- name: Checkout
uses: actions/checkout@v2
msystem: ${{matrix.sys}}

- name: Install libraries
run: |
echo 'Y'| pacman -S base-devel git gcc make
- name: Install Clang and Go for MINGW64
run: |
echo 'y'| pacman -S mingw-w64-x86_64-clang mingw-w64-x86_64-go zip unzip
- name: Set environment variables
run: |
export GOROOT=/mingw64/lib/go
export GOPATH=/mingw64
export PATH=$PATH:$GOROOT/bin
export PATH=$PATH:/usr/bin/7z
# use clang as a default compiler for CGO
go env -w "CC=/mingw64/bin/clang.exe"
- name: Install
run: make install

- name: Zip release
run: |
copy zwallet zwallet.exe
7z a zwallet-windows.zip zwallet.exe
# download dll files
wget https://github.com/0chain/zboxcli/files/11840033/windows.dll.s.zip
unzip -o windows.dll.s.zip
cp zwallet zwallet.exe
zip zwallet-windows.zip zwallet.exe libgcc_s_seh-1.dll libstdc++-6.dll libwinpthread-1.dll
- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
with:
name: zwallet-windows
path: zwallet
name: zwallet-windows.zip
path: zwallet-windows.zip
retention-days: 5

- name: cleanup workspace
run: |
rm -Recurse ${{github.workspace}}\*
shell: powershell

build-macos:
name: Build-MacOS
runs-on: macos-runner
Expand Down

0 comments on commit 9805a7b

Please sign in to comment.