From 073c1517f544b1dbc6a76ceff1b7236e28378696 Mon Sep 17 00:00:00 2001 From: dh <46441813+DeanHnter@users.noreply.github.com> Date: Tue, 6 Feb 2024 11:55:21 +0100 Subject: [PATCH 1/5] Added artifact publish. --- .github/workflows/go.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index bb4f9bd..edf3ef6 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -27,3 +27,32 @@ jobs: - name: Execute Task run: task build + + # If you want to create a release and upload the binary to that release: + - 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 Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./Client/docker + asset_name: docker-binary + asset_content_type: application/octet-stream + + # If you want to just upload the binary as a workflow artifact: + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: docker-binary + path: ./Client/docker From 14edcfec02ecc41dbb083951dfea536b529d68c9 Mon Sep 17 00:00:00 2001 From: dh <46441813+DeanHnter@users.noreply.github.com> Date: Tue, 6 Feb 2024 11:57:27 +0100 Subject: [PATCH 2/5] extend permissions --- .github/workflows/go.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index edf3ef6..8b2d533 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -3,8 +3,10 @@ name: Go on: push: branches: [ "develop" ] - pull_request: - branches: [ "develop" ] + +permissions: + contents: write + actions: read jobs: From dae29954c34d49cc5f2219024f59cb4f9e4bf79d Mon Sep 17 00:00:00 2001 From: dh <46441813+DeanHnter@users.noreply.github.com> Date: Tue, 6 Feb 2024 12:00:40 +0100 Subject: [PATCH 3/5] Update go.yml --- .github/workflows/go.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8b2d533..c309f7d 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -2,8 +2,9 @@ name: Go on: push: - branches: [ "develop" ] - + tags: + - '*' + permissions: contents: write actions: read @@ -30,17 +31,16 @@ jobs: - name: Execute Task run: task build - # If you want to create a release and upload the binary to that release: - name: Create Release id: create_release uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false + tag_name: ${{ github.ref_name }} + release_name: Release ${{ github.ref_name }} + draft: false + prerelease: false - name: Upload Release Asset uses: actions/upload-release-asset@v1 From 026360324847dc5c11dd399740119c7c20160ed9 Mon Sep 17 00:00:00 2001 From: dh <46441813+DeanHnter@users.noreply.github.com> Date: Tue, 6 Feb 2024 12:07:22 +0100 Subject: [PATCH 4/5] Update go.yml --- .github/workflows/go.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c309f7d..343bc59 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -2,8 +2,7 @@ name: Go on: push: - tags: - - '*' + branches: [ "develop" ] permissions: contents: write @@ -31,16 +30,20 @@ jobs: - name: Execute Task run: task build + - name: Generate Unique Tag + id: uniquetag + run: echo "RELEASE_TAG=$(date +'%Y%m%d%H%M%S')-$(git rev-parse --short HEAD)" >> $GITHUB_ENV + - name: Create Release id: create_release uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ github.ref_name }} - release_name: Release ${{ github.ref_name }} - draft: false - prerelease: false + tag_name: ${{ env.RELEASE_TAG }} + release_name: Release ${{ env.RELEASE_TAG }} + draft: false + prerelease: false - name: Upload Release Asset uses: actions/upload-release-asset@v1 From 585fe2675a294e926a164ca6370568e2d5a8759c Mon Sep 17 00:00:00 2001 From: dh <46441813+DeanHnter@users.noreply.github.com> Date: Tue, 6 Feb 2024 12:11:32 +0100 Subject: [PATCH 5/5] fixed artifact names --- .github/workflows/go.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 343bc59..969fccb 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -52,12 +52,11 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./Client/docker - asset_name: docker-binary + asset_name: docker asset_content_type: application/octet-stream - # If you want to just upload the binary as a workflow artifact: - name: Upload Artifact uses: actions/upload-artifact@v3 with: - name: docker-binary + name: docker path: ./Client/docker