From 096dfffaf87fea39dd785e2b9d6cbebe224acfb3 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 12:14:20 +0100 Subject: [PATCH 01/34] trying to build and upload assets to release --- .github/workflows/release.yml | 39 +++++++++++++++++++++++++++++++++++ installCurl.sh | 18 ++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 installCurl.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6482963 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +on: + push: + tags: + - '*' + +name: Upload Release Asset + +jobs: + build: + name: Upload Release Asset + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: make ${{ matrix.target }} + shell: bash + run: | + # workaround for https://github.com/actions/setup-go/issues/14 + #export GOPATH=${GITHUB_WORKSPACE}/go + #export PATH=$PATH:$GOPATH/bin + make $target + working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }} + env: + target: ${{ matrix.target }} + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + - name: Upload assets + uses: actions/upload-artifact@v2 + with: + name: booty + path: dist/* \ No newline at end of file diff --git a/installCurl.sh b/installCurl.sh new file mode 100644 index 0000000..493be2a --- /dev/null +++ b/installCurl.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Grab the binaries attached as release assets +curl -s https://api.github.com/repos/getcouragenow/main/releases/latest | jq -r ".assets[] | .browser_download_url" | xargs wget + +# WORKING EXAMPLE : +curl -s https://api.github.com/repos/NFSTools/Binary/releases/latest | jq -r ".assets[] | .browser_download_url" | xargs wget +zipfilename="$(curl -s https://api.github.com/repos/NFSTools/Binary/releases/latest | jq -r '.assets[].name')" +unzip -j $zipfilename -d binaries + +# Get the code as tar.gz, decompress.. +curl -L "$(curl -s https://api.github.com/repos/applinh-getcouragenow/main/releases/latest | jq -r ".tarball_url")" > main.tar.gz +chmod 700 main.tar.gz +mkdir main +tar xzvf main.tar.gz -C main --strip-components=1 +# .. then maybe cd inside it +# run make command +# then delete everything keep only the binaries \ No newline at end of file From ec7735e8e9d1a2f47cef0fef3e0d521cc54c150b Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 12:18:21 +0100 Subject: [PATCH 02/34] fixing file --- .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6482963..f7437f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,13 +5,45 @@ on: name: Upload Release Asset + jobs: - build: - name: Upload Release Asset - runs-on: ubuntu-latest + all: + name: Upload Release Asset + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + go-version: [1.15.6] + target: ["all"] + + runs-on: ${{ matrix.os }} + steps: - - name: Checkout code + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + id: go + + - name: Setup Go binary path + shell: bash + run: | + echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV + echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + + - name: Git line endings + shell: bash + run: | + git config --global core.autocrlf false + git config --global core.eol lf + + - name: Check out THIS code into the Go module directory uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }} + - name: make ${{ matrix.target }} shell: bash run: | @@ -22,6 +54,8 @@ jobs: working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }} env: target: ${{ matrix.target }} + + - name: Create Release id: create_release uses: actions/create-release@v1 From 4a990448468f99ec63d56e3e7719ed0af3beaf13 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 12:30:48 +0100 Subject: [PATCH 03/34] dist not found trying to fix --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f7437f4..24442e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,4 +70,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: booty - path: dist/* \ No newline at end of file + path: /home/runner/work/booty/booty/go/src/github.com/applinh-getcouragenow/booty/example/dist/* \ No newline at end of file From 2ef88b78cf92fdef8b38fe11107d9f1cba7a7f59 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 12:37:33 +0100 Subject: [PATCH 04/34] reducing to ubuntu only for debug --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 24442e0..6df7566 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest] # [ubuntu-latest, macos-latest, windows-latest] go-version: [1.15.6] target: ["all"] From 696581dac468ff404a1cacbb4431d43005ff6447 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 13:10:23 +0100 Subject: [PATCH 05/34] trying to upload with diff action --- .github/workflows/release.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6df7566..1941add 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,11 +63,18 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} + release_name: ${{ github.ref }} draft: false prerelease: false - name: Upload assets - uses: actions/upload-artifact@v2 + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - name: booty - path: /home/runner/work/booty/booty/go/src/github.com/applinh-getcouragenow/booty/example/dist/* \ No newline at end of file + # name: booty + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/booty_${{github.ref}}-SNAPSHOT-{{ $GITHUB_SHA" }}_Linux_x86_64.tar.gz + asset_name: booty_${{github.ref}}-SNAPSHOT-{{ $GITHUB_SHA" }}_Linux_x86_64.tar.gz + asset_content_type: application/tar.gz + \ No newline at end of file From ea76be90bbd24a3ff7bae9f137b271e15e0cc7bc Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 13:13:56 +0100 Subject: [PATCH 06/34] typo --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1941add..4166584 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -74,7 +74,7 @@ jobs: with: # name: booty upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/booty_${{github.ref}}-SNAPSHOT-{{ $GITHUB_SHA" }}_Linux_x86_64.tar.gz - asset_name: booty_${{github.ref}}-SNAPSHOT-{{ $GITHUB_SHA" }}_Linux_x86_64.tar.gz + asset_path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/booty_${{github.ref}}-SNAPSHOT-{{ $GITHUB_SHA }}_Linux_x86_64.tar.gz + asset_name: booty_${{github.ref}}-SNAPSHOT-{{ $GITHUB_SHA }}_Linux_x86_64.tar.gz asset_content_type: application/tar.gz \ No newline at end of file From bff27f3080f12814511f65b53f410b5ee077f832 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 13:17:29 +0100 Subject: [PATCH 07/34] typo --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4166584..e08d52c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -74,7 +74,7 @@ jobs: with: # name: booty upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/booty_${{github.ref}}-SNAPSHOT-{{ $GITHUB_SHA }}_Linux_x86_64.tar.gz + asset_path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/booty_${{github.ref}}-SNAPSHOT-{$GITHUB_SHA}_Linux_x86_64.tar.gz asset_name: booty_${{github.ref}}-SNAPSHOT-{{ $GITHUB_SHA }}_Linux_x86_64.tar.gz asset_content_type: application/tar.gz \ No newline at end of file From d80e5bf49fe2170aa230de9edc540601a3c11bd0 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 13:20:34 +0100 Subject: [PATCH 08/34] typo again ffs --- .github/workflows/release.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e08d52c..951916b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -74,7 +74,6 @@ jobs: with: # name: booty upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/booty_${{github.ref}}-SNAPSHOT-{$GITHUB_SHA}_Linux_x86_64.tar.gz + asset_path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/booty_${{github.ref}}-SNAPSHOT-${GITHUB_SHA}_Linux_x86_64.tar.gz asset_name: booty_${{github.ref}}-SNAPSHOT-{{ $GITHUB_SHA }}_Linux_x86_64.tar.gz - asset_content_type: application/tar.gz - \ No newline at end of file + asset_content_type: application/tar.gz \ No newline at end of file From ba3dec056f71cfb0313256b9d2eb896f1b272917 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 13:24:39 +0100 Subject: [PATCH 09/34] trying to get sha from env --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 951916b..bcdbb86 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -74,6 +74,6 @@ jobs: with: # name: booty upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/booty_${{github.ref}}-SNAPSHOT-${GITHUB_SHA}_Linux_x86_64.tar.gz + asset_path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/booty_${{github.ref}}-SNAPSHOT-${{ env.GITHUB_SHA }}_Linux_x86_64.tar.gz asset_name: booty_${{github.ref}}-SNAPSHOT-{{ $GITHUB_SHA }}_Linux_x86_64.tar.gz asset_content_type: application/tar.gz \ No newline at end of file From 0c947cd912afd88376d678c4faf5a134e5bcc0a9 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 13:35:25 +0100 Subject: [PATCH 10/34] another way --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bcdbb86..6da385a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -74,6 +74,6 @@ jobs: with: # name: booty upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/booty_${{github.ref}}-SNAPSHOT-${{ env.GITHUB_SHA }}_Linux_x86_64.tar.gz + asset_path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/booty_${{github.ref}}-SNAPSHOT-${{ github.sha }}_Linux_x86_64.tar.gz asset_name: booty_${{github.ref}}-SNAPSHOT-{{ $GITHUB_SHA }}_Linux_x86_64.tar.gz asset_content_type: application/tar.gz \ No newline at end of file From 962a20f308335be67340ab867ea9fa249e87efa2 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 13:57:51 +0100 Subject: [PATCH 11/34] using something else to release artifacts --- .github/workflows/release.yml | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6da385a..94e82df 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,6 +55,7 @@ jobs: env: target: ${{ matrix.target }} + # ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ - name: Create Release id: create_release @@ -66,14 +67,25 @@ jobs: release_name: ${{ github.ref }} draft: false prerelease: false - - name: Upload assets - id: upload-release-asset - uses: actions/upload-release-asset@v1 + + - name: Release + uses: fnkr/github-action-ghr@v1 env: + GHR_COMPRESS: xz + GHR_PATH: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - # name: booty - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/booty_${{github.ref}}-SNAPSHOT-${{ github.sha }}_Linux_x86_64.tar.gz - asset_name: booty_${{github.ref}}-SNAPSHOT-{{ $GITHUB_SHA }}_Linux_x86_64.tar.gz - asset_content_type: application/tar.gz \ No newline at end of file + + + + + # - name: Upload assets + # id: upload-release-asset + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # # name: booty + # upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + # asset_path: booty_${{github.ref}}-SNAPSHOT-${{ github.sha }}_Linux_x86_64.tar.gz + # asset_name: booty_${{github.ref}}-SNAPSHOT-{{ $GITHUB_SHA }}_Linux_x86_64.tar.gz + # asset_content_type: application/tar.gz \ No newline at end of file From 2e2e37e0e3bf6cf44f478657fd936079113a4c49 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 14:25:45 +0100 Subject: [PATCH 12/34] removing the compress env --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 94e82df..810362a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,7 +71,7 @@ jobs: - name: Release uses: fnkr/github-action-ghr@v1 env: - GHR_COMPRESS: xz + # GHR_COMPRESS: xz GHR_PATH: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From b043c8e4dddeac3917537d5b2ba7d7867116b5ef Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 15:15:37 +0100 Subject: [PATCH 13/34] create release then upload from different machines --- .github/workflows/release.yml | 50 ++++++++++++++--------------------- 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 810362a..c517438 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,13 +7,28 @@ name: Upload Release Asset jobs: - all: - name: Upload Release Asset + create_release: + name: Create Release + runs-on: ubuntu-16.04 + steps: + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: false + prerelease: false + + upload_release_assets: + name: Upload Release Assets strategy: fail-fast: false matrix: - os: [ubuntu-latest] # [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] go-version: [1.15.6] target: ["all"] @@ -56,36 +71,11 @@ jobs: target: ${{ matrix.target }} # ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ - - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - draft: false - prerelease: false + - name: Release uses: fnkr/github-action-ghr@v1 env: # GHR_COMPRESS: xz GHR_PATH: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - - - # - name: Upload assets - # id: upload-release-asset - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # # name: booty - # upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - # asset_path: booty_${{github.ref}}-SNAPSHOT-${{ github.sha }}_Linux_x86_64.tar.gz - # asset_name: booty_${{github.ref}}-SNAPSHOT-{{ $GITHUB_SHA }}_Linux_x86_64.tar.gz - # asset_content_type: application/tar.gz \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 66826c8f7eea95d335ad6e2f4656de0ac5d741e3 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 15:23:24 +0100 Subject: [PATCH 14/34] used dep is not compatible on windows/macos --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c517438..5d79563 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -75,6 +75,7 @@ jobs: - name: Release uses: fnkr/github-action-ghr@v1 + if: ${{ matrix.os }} == 'ubuntu-latest' env: # GHR_COMPRESS: xz GHR_PATH: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ From 189fdc3509ba1f8035efdcb6372f94d15661c97a Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 15:41:13 +0100 Subject: [PATCH 15/34] trying to share artifacts between jobs cuz ghr only linux --- .github/workflows/release.yml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d79563..4bb1967 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,8 +22,8 @@ jobs: draft: false prerelease: false - upload_release_assets: - name: Upload Release Assets + create_release_assets: + name: Create Release Assets strategy: fail-fast: false @@ -71,12 +71,26 @@ jobs: target: ${{ matrix.target }} # ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ - + + - name: Share artifacts + uses: actions/upload-artifact@master + with: + name: ${{ github.repository }} - ${{ matrix.os }} + path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ + + upload_release_assets: + name: Create Release Assets + needs: create_release_assets + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@master + with: + name: ${{ github.repository }} - ubuntu-latest + path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ - name: Release uses: fnkr/github-action-ghr@v1 - if: ${{ matrix.os }} == 'ubuntu-latest' env: # GHR_COMPRESS: xz GHR_PATH: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 085889c701d77d18a9b4f30b61365abadd63ea61 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 15:44:56 +0100 Subject: [PATCH 16/34] changing artifact name cuz not compatible --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4bb1967..011c275 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -75,17 +75,17 @@ jobs: - name: Share artifacts uses: actions/upload-artifact@master with: - name: ${{ github.repository }} - ${{ matrix.os }} + name: booty-${{ matrix.os }} path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ upload_release_assets: - name: Create Release Assets + name: Upload Release Assets needs: create_release_assets runs-on: ubuntu-latest steps: - uses: actions/download-artifact@master with: - name: ${{ github.repository }} - ubuntu-latest + name: booty-ubuntu-latest path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ - name: Release From 0bc2132717fafd504651fd1e7d8bb4a3192c73e0 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 15:52:42 +0100 Subject: [PATCH 17/34] getting the artifacts from the other jobs as well + (macos/windows) --- .github/workflows/release.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 011c275..33f6d82 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,11 +83,24 @@ jobs: needs: create_release_assets runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@master + - name: Get Ubuntu artifacts + uses: actions/download-artifact@master with: name: booty-ubuntu-latest path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ - + + - name: Get Windows artifacts + uses: actions/download-artifact@master + with: + name: booty-windows-latest + path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ + + - name: Get MacOS artifacts + uses: actions/download-artifact@master + with: + name: booty-macos-latest + path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ + - name: Release uses: fnkr/github-action-ghr@v1 env: From 444e430487cbaa8edd1fe2f5ba6b86a71dd7d27b Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 16:05:20 +0100 Subject: [PATCH 18/34] artifacts don't seem to be retrieved correctly.. fixing --- .github/workflows/release.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 33f6d82..2fd067a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -87,23 +87,28 @@ jobs: uses: actions/download-artifact@master with: name: booty-ubuntu-latest - path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ + path: ~/booty/booty-ubuntu-latest - name: Get Windows artifacts uses: actions/download-artifact@master with: name: booty-windows-latest - path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ + path: ~/booty/booty-windows-latest - name: Get MacOS artifacts uses: actions/download-artifact@master with: name: booty-macos-latest - path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ - + path: ~/booty/booty-macos-latest + - name: Show artifacts + shell: bash + run: | + ls ~/booty/booty-ubuntu-latest + ls ~/booty/booty-macos-latest + ls ~/booty/booty-windows-latest - name: Release uses: fnkr/github-action-ghr@v1 env: # GHR_COMPRESS: xz - GHR_PATH: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ + GHR_PATH: ~/booty/ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 40cbb356baf3fef59f14b2db3c650bcbb242cde5 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 16:26:38 +0100 Subject: [PATCH 19/34] we eventually only need ubuntu, so let's go --- .github/workflows/release.yml | 47 ++++------------------------------- 1 file changed, 5 insertions(+), 42 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2fd067a..22cce8e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,13 +22,13 @@ jobs: draft: false prerelease: false - create_release_assets: - name: Create Release Assets - + create_and_upload_release_assets: + name: Create and Upload Release Assets + needs: create_release strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest] #[ubuntu-latest, macos-latest, windows-latest] go-version: [1.15.6] target: ["all"] @@ -70,45 +70,8 @@ jobs: env: target: ${{ matrix.target }} - # ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ - - - name: Share artifacts - uses: actions/upload-artifact@master - with: - name: booty-${{ matrix.os }} - path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ - - upload_release_assets: - name: Upload Release Assets - needs: create_release_assets - runs-on: ubuntu-latest - steps: - - name: Get Ubuntu artifacts - uses: actions/download-artifact@master - with: - name: booty-ubuntu-latest - path: ~/booty/booty-ubuntu-latest - - - name: Get Windows artifacts - uses: actions/download-artifact@master - with: - name: booty-windows-latest - path: ~/booty/booty-windows-latest - - - name: Get MacOS artifacts - uses: actions/download-artifact@master - with: - name: booty-macos-latest - path: ~/booty/booty-macos-latest - - name: Show artifacts - shell: bash - run: | - ls ~/booty/booty-ubuntu-latest - ls ~/booty/booty-macos-latest - ls ~/booty/booty-windows-latest - name: Release uses: fnkr/github-action-ghr@v1 env: - # GHR_COMPRESS: xz - GHR_PATH: ~/booty/ + GHR_PATH: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c8a8c9b7ce7afe74c9d6711363089a1b6e1538e4 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 16:46:34 +0100 Subject: [PATCH 20/34] testing install curl --- installCurl.sh | 391 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 373 insertions(+), 18 deletions(-) mode change 100644 => 100755 installCurl.sh diff --git a/installCurl.sh b/installCurl.sh old mode 100644 new mode 100755 index 493be2a..23a285c --- a/installCurl.sh +++ b/installCurl.sh @@ -1,18 +1,373 @@ -#!/bin/bash - -# Grab the binaries attached as release assets -curl -s https://api.github.com/repos/getcouragenow/main/releases/latest | jq -r ".assets[] | .browser_download_url" | xargs wget - -# WORKING EXAMPLE : -curl -s https://api.github.com/repos/NFSTools/Binary/releases/latest | jq -r ".assets[] | .browser_download_url" | xargs wget -zipfilename="$(curl -s https://api.github.com/repos/NFSTools/Binary/releases/latest | jq -r '.assets[].name')" -unzip -j $zipfilename -d binaries - -# Get the code as tar.gz, decompress.. -curl -L "$(curl -s https://api.github.com/repos/applinh-getcouragenow/main/releases/latest | jq -r ".tarball_url")" > main.tar.gz -chmod 700 main.tar.gz -mkdir main -tar xzvf main.tar.gz -C main --strip-components=1 -# .. then maybe cd inside it -# run make command -# then delete everything keep only the binaries \ No newline at end of file +#!/bin/sh +set -e +# Code generated by godownloader on 2019-12-25T12:47:12Z. DO NOT EDIT. +# + +usage() { + this=$1 + cat </dev/null +} +echoerr() { + echo "$@" 1>&2 +} +log_prefix() { + echo "$0" +} +_logp=6 +log_set_priority() { + _logp="$1" +} +log_priority() { + if test -z "$1"; then + echo "$_logp" + return + fi + [ "$1" -le "$_logp" ] +} +log_tag() { + case $1 in + 0) echo "emerg" ;; + 1) echo "alert" ;; + 2) echo "crit" ;; + 3) echo "err" ;; + 4) echo "warning" ;; + 5) echo "notice" ;; + 6) echo "info" ;; + 7) echo "debug" ;; + *) echo "$1" ;; + esac +} +log_debug() { + log_priority 7 || return 0 + echoerr "$(log_prefix)" "$(log_tag 7)" "$@" +} +log_info() { + log_priority 6 || return 0 + echoerr "$(log_prefix)" "$(log_tag 6)" "$@" +} +log_err() { + log_priority 3 || return 0 + echoerr "$(log_prefix)" "$(log_tag 3)" "$@" +} +log_crit() { + log_priority 2 || return 0 + echoerr "$(log_prefix)" "$(log_tag 2)" "$@" +} +uname_os() { + os=$(uname -s | tr '[:upper:]' '[:lower:]') + case "$os" in + cygwin_nt*) os="windows" ;; + mingw*) os="windows" ;; + msys_nt*) os="windows" ;; + esac + echo "$os" +} +uname_arch() { + arch=$(uname -m) + case $arch in + x86_64) arch="amd64" ;; + x86) arch="386" ;; + i686) arch="386" ;; + i386) arch="386" ;; + aarch64) arch="arm64" ;; + armv5*) arch="armv5" ;; + armv6*) arch="armv6" ;; + armv7*) arch="armv7" ;; + esac + echo ${arch} +} +uname_os_check() { + os=$(uname_os) + case "$os" in + darwin) return 0 ;; + dragonfly) return 0 ;; + freebsd) return 0 ;; + linux) return 0 ;; + android) return 0 ;; + nacl) return 0 ;; + netbsd) return 0 ;; + openbsd) return 0 ;; + plan9) return 0 ;; + solaris) return 0 ;; + windows) return 0 ;; + esac + log_crit "uname_os_check '$(uname -s)' got converted to '$os' which is not a GOOS value. Please file bug at https://github.com/client9/shlib" + return 1 +} +uname_arch_check() { + arch=$(uname_arch) + case "$arch" in + 386) return 0 ;; + amd64) return 0 ;; + arm64) return 0 ;; + armv5) return 0 ;; + armv6) return 0 ;; + armv7) return 0 ;; + ppc64) return 0 ;; + ppc64le) return 0 ;; + mips) return 0 ;; + mipsle) return 0 ;; + mips64) return 0 ;; + mips64le) return 0 ;; + s390x) return 0 ;; + amd64p32) return 0 ;; + esac + log_crit "uname_arch_check '$(uname -m)' got converted to '$arch' which is not a GOARCH value. Please file bug report at https://github.com/client9/shlib" + return 1 +} +untar() { + tarball=$1 + case "${tarball}" in + *.tar.gz | *.tgz) tar --no-same-owner -xzf "${tarball}" ;; + *.tar) tar --no-same-owner -xf "${tarball}" ;; + *.zip) unzip "${tarball}" ;; + *) + log_err "untar unknown archive format for ${tarball}" + return 1 + ;; + esac +} +http_download_curl() { + local_file=$1 + source_url=$2 + header=$3 + if [ -z "$header" ]; then + code=$(curl -w '%{http_code}' -sL -o "$local_file" "$source_url") + else + code=$(curl -w '%{http_code}' -sL -H "$header" -o "$local_file" "$source_url") + fi + if [ "$code" != "200" ]; then + log_debug "http_download_curl received HTTP status $code" + return 1 + fi + return 0 +} +http_download_wget() { + local_file=$1 + source_url=$2 + header=$3 + if [ -z "$header" ]; then + wget -q -O "$local_file" "$source_url" + else + wget -q --header "$header" -O "$local_file" "$source_url" + fi +} +http_download() { + log_debug "http_download $2" + if is_command curl; then + http_download_curl "$@" + return + elif is_command wget; then + http_download_wget "$@" + return + fi + log_crit "http_download unable to find wget or curl" + return 1 +} +http_copy() { + tmp=$(mktemp) + http_download "${tmp}" "$1" "$2" || return 1 + body=$(cat "$tmp") + rm -f "${tmp}" + echo "$body" +} +github_release() { + owner_repo=$1 + version=$2 + test -z "$version" && version="latest" + giturl="https://github.com/${owner_repo}/releases/${version}" + json=$(http_copy "$giturl" "Accept:application/json") + test -z "$json" && return 1 + version=$(echo "$json" | tr -s '\n' ' ' | sed 's/.*"tag_name":"//' | sed 's/".*//') + test -z "$version" && return 1 + echo "$version" +} +hash_sha256() { + TARGET=${1:-/dev/stdin} + if is_command gsha256sum; then + hash=$(gsha256sum "$TARGET") || return 1 + echo "$hash" | cut -d ' ' -f 1 + elif is_command sha256sum; then + hash=$(sha256sum "$TARGET") || return 1 + echo "$hash" | cut -d ' ' -f 1 + elif is_command shasum; then + hash=$(shasum -a 256 "$TARGET" 2>/dev/null) || return 1 + echo "$hash" | cut -d ' ' -f 1 + elif is_command openssl; then + hash=$(openssl -dst openssl dgst -sha256 "$TARGET") || return 1 + echo "$hash" | cut -d ' ' -f a + else + log_crit "hash_sha256 unable to find command to compute sha-256 hash" + return 1 + fi +} +hash_sha256_verify() { + TARGET=$1 + checksums=$2 + if [ -z "$checksums" ]; then + log_err "hash_sha256_verify checksum file not specified in arg2" + return 1 + fi + BASENAME=${TARGET##*/} + want=$(grep "${BASENAME}" "${checksums}" 2>/dev/null | tr '\t' ' ' | cut -d ' ' -f 1) + if [ -z "$want" ]; then + log_err "hash_sha256_verify unable to find checksum for '${TARGET}' in '${checksums}'" + return 1 + fi + got=$(hash_sha256 "$TARGET") + if [ "$want" != "$got" ]; then + log_err "hash_sha256_verify checksum for '$TARGET' did not verify ${want} vs $got" + return 1 + fi +} +cat /dev/null < Date: Tue, 26 Jan 2021 17:10:19 +0100 Subject: [PATCH 21/34] trying release with goreleaser --- .github/workflows/release.yml | 12 ++++++------ example/makefile | 4 +++- installCurl.sh | 5 +++++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 22cce8e..d5234ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: matrix: os: [ubuntu-latest] #[ubuntu-latest, macos-latest, windows-latest] go-version: [1.15.6] - target: ["all"] + target: ["all-release"] runs-on: ${{ matrix.os }} @@ -70,8 +70,8 @@ jobs: env: target: ${{ matrix.target }} - - name: Release - uses: fnkr/github-action-ghr@v1 - env: - GHR_PATH: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Release + # uses: fnkr/github-action-ghr@v1 + # env: + # GHR_PATH: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/example/dist/ + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/example/makefile b/example/makefile index ce3d05c..36df74c 100644 --- a/example/makefile +++ b/example/makefile @@ -3,6 +3,7 @@ BOOTY_FSPATH=./.. include $(BOOTY_FSPATH)/*.mk all: print dep build release +all-release: all full-release print: @echo -- OS -- @@ -24,7 +25,8 @@ release: #goreleaser --rm-dist goreleaser --rm-dist --skip-publish --snapshot - +full-release: + goreleaser release server-run: cd ./go/cmd/server && ./server diff --git a/installCurl.sh b/installCurl.sh index 23a285c..b7a1f96 100755 --- a/installCurl.sh +++ b/installCurl.sh @@ -45,12 +45,17 @@ parse_args() { execute() { tmpdir=$(mktemp -d) log_debug "downloading files into ${tmpdir}" + echo "${tmpdir}/${TARBALL}" "${TARBALL_URL}" http_download "${tmpdir}/${TARBALL}" "${TARBALL_URL}" + echo "here" http_download "${tmpdir}/${CHECKSUM}" "${CHECKSUM_URL}" + hash_sha256_verify "${tmpdir}/${TARBALL}" "${tmpdir}/${CHECKSUM}" srcdir="${tmpdir}" + (cd "${tmpdir}" && untar "${TARBALL}") test ! -d "${BINDIR}" && install -d "${BINDIR}" + for binexe in $BINARIES; do if [ "$OS" = "windows" ]; then binexe="${binexe}.exe" From b0441e01e8637293abb87aac5558056256343a1f Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 17:13:44 +0100 Subject: [PATCH 22/34] wrong way oops --- example/makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/example/makefile b/example/makefile index 36df74c..00c59e2 100644 --- a/example/makefile +++ b/example/makefile @@ -3,7 +3,6 @@ BOOTY_FSPATH=./.. include $(BOOTY_FSPATH)/*.mk all: print dep build release -all-release: all full-release print: @echo -- OS -- @@ -24,8 +23,6 @@ release: #git push origin $(VERSION) #goreleaser --rm-dist goreleaser --rm-dist --skip-publish --snapshot - -full-release: goreleaser release server-run: From 03b1a017ae8f0bce95ef46f641b52dde87747513 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 17:14:56 +0100 Subject: [PATCH 23/34] typo --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d5234ae..dde619b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: matrix: os: [ubuntu-latest] #[ubuntu-latest, macos-latest, windows-latest] go-version: [1.15.6] - target: ["all-release"] + target: ["all"] runs-on: ${{ matrix.os }} From dbfb2e16babd67aaad7336eada6210e98418e639 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 17:18:21 +0100 Subject: [PATCH 24/34] adding token --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dde619b..071b71b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,6 +69,7 @@ jobs: working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }} env: target: ${{ matrix.target }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # - name: Release # uses: fnkr/github-action-ghr@v1 From 0285850cc77f28740368bce9833d9d5bb1779dc6 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 17:29:07 +0100 Subject: [PATCH 25/34] fix mk --- example/makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/makefile b/example/makefile index 00c59e2..8363a9b 100644 --- a/example/makefile +++ b/example/makefile @@ -22,8 +22,8 @@ release: #git tag -a $(VERSION) -m "Release" || true #git push origin $(VERSION) #goreleaser --rm-dist - goreleaser --rm-dist --skip-publish --snapshot - goreleaser release + goreleaser release --rm-dist --skip-publish --snapshot + # goreleaser release server-run: cd ./go/cmd/server && ./server From 91c5bafb3c9466686f4e8e16c50cab2fef31f10c Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 17:37:16 +0100 Subject: [PATCH 26/34] fix mk again --- example/makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/makefile b/example/makefile index 8363a9b..309720f 100644 --- a/example/makefile +++ b/example/makefile @@ -22,8 +22,8 @@ release: #git tag -a $(VERSION) -m "Release" || true #git push origin $(VERSION) #goreleaser --rm-dist - goreleaser release --rm-dist --skip-publish --snapshot - # goreleaser release + #goreleaser --rm-dist --skip-publish --snapshot + goreleaser release server-run: cd ./go/cmd/server && ./server From 3f1d2215f7d9f77f0ca7ff3a48372196fe0b4c3a Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 17:51:39 +0100 Subject: [PATCH 27/34] changing repl so chang artif name --- example/.goreleaser.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/.goreleaser.yml b/example/.goreleaser.yml index a81bf1c..433a95d 100644 --- a/example/.goreleaser.yml +++ b/example/.goreleaser.yml @@ -34,6 +34,6 @@ archives: linux: Linux windows: Windows 386: i386 - amd64: x86_64 + #amd64: x86_64 checksum: name_template: 'checksums.txt' From 469b2f19c7b0bca71394d2775bbe1373534a5148 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Tue, 26 Jan 2021 18:10:30 +0100 Subject: [PATCH 28/34] install script ready but hash_sha256_verify fails --- installCurl.sh => install.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) rename installCurl.sh => install.sh (95%) diff --git a/installCurl.sh b/install.sh similarity index 95% rename from installCurl.sh rename to install.sh index b7a1f96..21b6650 100755 --- a/installCurl.sh +++ b/install.sh @@ -6,13 +6,13 @@ set -e usage() { this=$1 cat < Date: Tue, 26 Jan 2021 18:28:33 +0100 Subject: [PATCH 29/34] trying to use go downloader, install in mk --- example/makefile | 2 ++ mkdep/all.mk | 2 ++ mkdep/godownloader.mk | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 mkdep/godownloader.mk diff --git a/example/makefile b/example/makefile index 309720f..235adcc 100644 --- a/example/makefile +++ b/example/makefile @@ -24,6 +24,8 @@ release: #goreleaser --rm-dist #goreleaser --rm-dist --skip-publish --snapshot goreleaser release + godownloader --repo=applinh-getcouragenow/booty > ./godownloader-booty.sh + server-run: cd ./go/cmd/server && ./server diff --git a/mkdep/all.mk b/mkdep/all.mk index b8d150f..c3449b5 100644 --- a/mkdep/all.mk +++ b/mkdep/all.mk @@ -26,6 +26,7 @@ dep-all-print: # where is home for each OS ? @echo HOME_ENV: $${HOME} $(MAKE) gor-print + $(MAKE) god-dep $(MAKE) pro-print #$(MAKE) grafana-print @@ -36,4 +37,5 @@ dep-all-install: @echo $(MAKE) dwn-print $(MAKE) gor-dep + $(MAKE) god-dep #$(MAKE) grafana-dep \ No newline at end of file diff --git a/mkdep/godownloader.mk b/mkdep/godownloader.mk new file mode 100644 index 0000000..5ad4822 --- /dev/null +++ b/mkdep/godownloader.mk @@ -0,0 +1,42 @@ +# godownloader (gor) +# https://github.com/goreleaser/godownloader + +### BIN +GOD_BIN=godownloader + +GOD_BIN_VERSION=0.149.0 +ifeq ($(GOOS),darwin) + GOD_BIN_PLATFORM:=Darwin_x86_64.tar.gz +endif +ifeq ($(GOOS),windows) + echo 'WINDOWS IS NOT SUPPORTED' +endif +ifeq ($(GOOS),linux) + GOD_BIN_PLATFORM:=Linux_x86_64.tar.gz +endif +GOD_BIN_FILE=godownloader_$(GOD_BIN_PLATFORM) +GOD_BIN_URL=https://github.com/goreleaser/godownloader/releases/download/v$(GOD_BIN_VERSION)/$(GOD_BIN_FILE) + + +gor-print: + @echo -- GORELEASE Dep -- + @echo GOD_BIN_VERSION: $(GOD_BIN_VERSION) + @echo GOD_BIN_URL: $(GOD_BIN_URL) + @echo GOD_BIN_URLFILE: $(GOD_BIN_FILE) + @echo GOD_BIN: $(GOD_BIN) + @echo + +gor-dep: gor-dep-delete + $(MAKE) DWN_URL=$(GOD_BIN_URL) \ + DWN_FILENAME=$(GOD_BIN_FILE) \ + DWN_BIN_NAME=$(GOD_BIN) \ + DWN_BIN_OUTPUT_DIR=$(INSTALL_DOWNLOAD_DIR) dwn-download + +gor-dep-delete: + $(MAKE) DWN_URL=$(GOD_BIN_URL) \ + DWN_FILENAME=$(GOD_BIN_FILE) \ + DWN_BIN_NAME=$(GOD_BIN) \ + DWN_BIN_OUTPUT_DIR=$(INSTALL_DOWNLOAD_DIR) dwn-delete + + + \ No newline at end of file From 53e1c8e66d216c0bc9888f584ffb058066cd8a51 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Wed, 27 Jan 2021 11:52:44 +0100 Subject: [PATCH 30/34] revert godl --- example/makefile | 1 - install.sh | 2 +- mkdep/all.mk | 2 -- mkdep/godownloader.mk | 42 ------------------------------------------ 4 files changed, 1 insertion(+), 46 deletions(-) delete mode 100644 mkdep/godownloader.mk diff --git a/example/makefile b/example/makefile index 235adcc..c004488 100644 --- a/example/makefile +++ b/example/makefile @@ -24,7 +24,6 @@ release: #goreleaser --rm-dist #goreleaser --rm-dist --skip-publish --snapshot goreleaser release - godownloader --repo=applinh-getcouragenow/booty > ./godownloader-booty.sh server-run: diff --git a/install.sh b/install.sh index 21b6650..b7327db 100755 --- a/install.sh +++ b/install.sh @@ -48,7 +48,7 @@ execute() { http_download "${tmpdir}/${TARBALL}" "${TARBALL_URL}" http_download "${tmpdir}/${CHECKSUM}" "${CHECKSUM_URL}" echo "${tmpdir}/${CHECKSUM}" "${CHECKSUM_URL}" - #hash_sha256_verify "${tmpdir}/${TARBALL}" "${tmpdir}/${CHECKSUM}" + #hash_sha256_verify "${tmpdir}/${TARBALL}" "${tmpdir}/${CHECKSUM}" <- TODO: fix this srcdir="${tmpdir}" (cd "${tmpdir}" && untar "${TARBALL}") diff --git a/mkdep/all.mk b/mkdep/all.mk index c3449b5..b8d150f 100644 --- a/mkdep/all.mk +++ b/mkdep/all.mk @@ -26,7 +26,6 @@ dep-all-print: # where is home for each OS ? @echo HOME_ENV: $${HOME} $(MAKE) gor-print - $(MAKE) god-dep $(MAKE) pro-print #$(MAKE) grafana-print @@ -37,5 +36,4 @@ dep-all-install: @echo $(MAKE) dwn-print $(MAKE) gor-dep - $(MAKE) god-dep #$(MAKE) grafana-dep \ No newline at end of file diff --git a/mkdep/godownloader.mk b/mkdep/godownloader.mk deleted file mode 100644 index 5ad4822..0000000 --- a/mkdep/godownloader.mk +++ /dev/null @@ -1,42 +0,0 @@ -# godownloader (gor) -# https://github.com/goreleaser/godownloader - -### BIN -GOD_BIN=godownloader - -GOD_BIN_VERSION=0.149.0 -ifeq ($(GOOS),darwin) - GOD_BIN_PLATFORM:=Darwin_x86_64.tar.gz -endif -ifeq ($(GOOS),windows) - echo 'WINDOWS IS NOT SUPPORTED' -endif -ifeq ($(GOOS),linux) - GOD_BIN_PLATFORM:=Linux_x86_64.tar.gz -endif -GOD_BIN_FILE=godownloader_$(GOD_BIN_PLATFORM) -GOD_BIN_URL=https://github.com/goreleaser/godownloader/releases/download/v$(GOD_BIN_VERSION)/$(GOD_BIN_FILE) - - -gor-print: - @echo -- GORELEASE Dep -- - @echo GOD_BIN_VERSION: $(GOD_BIN_VERSION) - @echo GOD_BIN_URL: $(GOD_BIN_URL) - @echo GOD_BIN_URLFILE: $(GOD_BIN_FILE) - @echo GOD_BIN: $(GOD_BIN) - @echo - -gor-dep: gor-dep-delete - $(MAKE) DWN_URL=$(GOD_BIN_URL) \ - DWN_FILENAME=$(GOD_BIN_FILE) \ - DWN_BIN_NAME=$(GOD_BIN) \ - DWN_BIN_OUTPUT_DIR=$(INSTALL_DOWNLOAD_DIR) dwn-download - -gor-dep-delete: - $(MAKE) DWN_URL=$(GOD_BIN_URL) \ - DWN_FILENAME=$(GOD_BIN_FILE) \ - DWN_BIN_NAME=$(GOD_BIN) \ - DWN_BIN_OUTPUT_DIR=$(INSTALL_DOWNLOAD_DIR) dwn-delete - - - \ No newline at end of file From ad46349e2ea9d1177c37da164a8b60d5cfe01d95 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Wed, 27 Jan 2021 11:54:28 +0100 Subject: [PATCH 31/34] changed owner --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index b7327db..5c86cc3 100755 --- a/install.sh +++ b/install.sh @@ -334,7 +334,7 @@ End of functions from https://github.com/client9/shlib EOF PROJECT_NAME="booty" -OWNER='applinh-getcouragenow' +OWNER='getcouragenow' REPO="booty" BINARY=booty FORMAT=tar.gz From df3c430b850e87ca418f6bc115be6043c2b83298 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Wed, 27 Jan 2021 12:01:41 +0100 Subject: [PATCH 32/34] trigger on push tag beggining with v --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 071b71b..b747201 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,7 @@ on: push: tags: - - '*' + - 'v*' name: Upload Release Asset From 3e8c9c35f97d261db5953fe8b8dc04684e9eb0bb Mon Sep 17 00:00:00 2001 From: AppliNH Date: Wed, 27 Jan 2021 12:07:47 +0100 Subject: [PATCH 33/34] fixing makefile an d targets --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- example/makefile | 14 ++++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2109d9..5491e38 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] go-version: [1.15.6] - target: ["all"] + target: ["all-ci"] runs-on: ${{ matrix.os }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b747201..937cda8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: matrix: os: [ubuntu-latest] #[ubuntu-latest, macos-latest, windows-latest] go-version: [1.15.6] - target: ["all"] + target: ["all-release"] runs-on: ${{ matrix.os }} diff --git a/example/makefile b/example/makefile index c004488..f73b00b 100644 --- a/example/makefile +++ b/example/makefile @@ -2,7 +2,11 @@ BOOTY_FSPATH=./.. include $(BOOTY_FSPATH)/*.mk -all: print dep build release +all: print dep build + +all-ci : all release-ci + +all-release: all release print: @echo -- OS -- @@ -18,12 +22,14 @@ build: cd ./go/cmd/cli && go build . cd ./go/cmd/server && go build . -release: +release-ci: #git tag -a $(VERSION) -m "Release" || true #git push origin $(VERSION) #goreleaser --rm-dist - #goreleaser --rm-dist --skip-publish --snapshot - goreleaser release + goreleaser --rm-dist --skip-publish --snapshot + +release: + goreleaser release server-run: From 5738c9c94568760f66c39b81ed513c24d4c30bd1 Mon Sep 17 00:00:00 2001 From: AppliNH Date: Wed, 27 Jan 2021 12:10:03 +0100 Subject: [PATCH 34/34] More mk modif --- makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile index 3d6cd49..d7f87a1 100644 --- a/makefile +++ b/makefile @@ -6,7 +6,9 @@ include ./help.mk include ./gitr.mk include ./mkdep/*.mk -all: this-print this-dep this-example-build this-example-release +all: this-print this-dep this-example-build +all-ci: all this-example-release-ci +all-release: all this-example-release #all: print dep @@ -46,7 +48,10 @@ this-example-all: this-example-build: cd ./example && $(MAKE) build +## example release ci +this-example-release-ci: + cd ./example && $(MAKE) release-ci + ## example release this-example-release: - cd ./example && $(MAKE) release - + cd ./example && $(MAKE) release \ No newline at end of file