From 9d83024729f3a207a8aaf321cf20fc26f4518316 Mon Sep 17 00:00:00 2001 From: NoSkillGuy Date: Mon, 9 Aug 2021 09:14:09 +0530 Subject: [PATCH 1/3] create binaries for release --- .github/workflows/build-cli.yaml | 138 +++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 .github/workflows/build-cli.yaml diff --git a/.github/workflows/build-cli.yaml b/.github/workflows/build-cli.yaml new file mode 100644 index 00000000..5a72e18c --- /dev/null +++ b/.github/workflows/build-cli.yaml @@ -0,0 +1,138 @@ +name: build-cli +on: + push: + branches: + - master + - dev + 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 \ No newline at end of file From 98cee986807b781787de272d87eacf39150205b3 Mon Sep 17 00:00:00 2001 From: NoSkillGuy Date: Mon, 9 Aug 2021 09:15:33 +0530 Subject: [PATCH 2/3] builds on feat/build-cli push for testing --- .github/workflows/build-cli.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-cli.yaml b/.github/workflows/build-cli.yaml index 5a72e18c..ff7fa12b 100644 --- a/.github/workflows/build-cli.yaml +++ b/.github/workflows/build-cli.yaml @@ -4,6 +4,7 @@ on: branches: - master - dev + - feat/build-cli tags: - 'v*.*.*' From f829cef8b910b0d85c46b18994c10ce3171a6a12 Mon Sep 17 00:00:00 2001 From: NoSkillGuy Date: Mon, 9 Aug 2021 09:18:38 +0530 Subject: [PATCH 3/3] removing the older build workflow --- .github/workflows/build.yaml | 54 ------------------------------------ 1 file changed, 54 deletions(-) delete mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index f4d821ae..00000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,54 +0,0 @@ -name: build-cli -on: [push] -jobs: - build-linux: - name: Build-linux - runs-on: ubuntu-latest - steps: - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Install - run: make install - - - name: 'Upload Artifact' - uses: actions/upload-artifact@v2 - with: - name: zbox-cli-linux - path: zbox - retention-days: 5 - build-windows: - name: Build-windows - runs-on: windows-latest - steps: - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Install - run: make install - - - name: 'Upload Artifact' - uses: actions/upload-artifact@v2 - with: - name: zbox-cli-windows - path: zbox - retention-days: 5 - build-mac: - name: Build-mac - runs-on: macos-latest - steps: - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Install - run: make install - - - name: 'Upload Artifact' - uses: actions/upload-artifact@v2 - with: - name: zbox-cli-macos - path: zbox - retention-days: 5 \ No newline at end of file