From e12449642329d6577f96c338729ce744bf4874ff Mon Sep 17 00:00:00 2001 From: dabziuebu4egh2 <159787696+dabziuebu4egh2@users.noreply.github.com> Date: Mon, 16 Dec 2024 08:43:56 +0100 Subject: [PATCH 1/6] Workflow test --- .github/workflows/go.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..ff5d40e --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,38 @@ +name: Go + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.20' + + - name: Install dependencies + run: go mod tidy + + - name: Build + run: go build -o cook ./cmd/cook + + - name: Test + run: go test -v ./... -cover + + - name: Create Release + id: create_release + uses: softprops/action-gh-release@v1 + with: + tag: ${{ github.ref }} + files: cook + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 08001ba059d4b04a532150188a778f53d524eaef Mon Sep 17 00:00:00 2001 From: dabziuebu4egh2 <159787696+dabziuebu4egh2@users.noreply.github.com> Date: Mon, 16 Dec 2024 08:47:33 +0100 Subject: [PATCH 2/6] Update go.yml --- .github/workflows/go.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ff5d40e..1228a50 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -20,13 +20,13 @@ jobs: go-version: '1.20' - name: Install dependencies - run: go mod tidy + run: go mod tidy ./v2 - name: Build - run: go build -o cook ./cmd/cook + run: go build -o cook ./v2/cmd/cook - name: Test - run: go test -v ./... -cover + run: go test -v ./v2/... -cover - name: Create Release id: create_release From d955b743b05338353e8d19264d80fe37bcfef04e Mon Sep 17 00:00:00 2001 From: dabziuebu4egh2 <159787696+dabziuebu4egh2@users.noreply.github.com> Date: Mon, 16 Dec 2024 08:48:44 +0100 Subject: [PATCH 3/6] Update go.yml --- .github/workflows/go.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 1228a50..e4a26fb 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -20,7 +20,9 @@ jobs: go-version: '1.20' - name: Install dependencies - run: go mod tidy ./v2 + run: | + cd v2 + go mod tidy - name: Build run: go build -o cook ./v2/cmd/cook From d0e41ced298a3c34c318e021d9bf58bfb40565f4 Mon Sep 17 00:00:00 2001 From: dabziuebu4egh2 <159787696+dabziuebu4egh2@users.noreply.github.com> Date: Mon, 16 Dec 2024 08:49:46 +0100 Subject: [PATCH 4/6] Update go.yml --- .github/workflows/go.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e4a26fb..8d62e09 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -25,11 +25,15 @@ jobs: go mod tidy - name: Build - run: go build -o cook ./v2/cmd/cook + run: | + cd v2 + go build -o cook ./cmd/cook - name: Test - run: go test -v ./v2/... -cover - + run: | + cd v2 + go test -v ./... -cover + - name: Create Release id: create_release uses: softprops/action-gh-release@v1 From 92fc3faa486e38ba95db68b261237b4552a5462d Mon Sep 17 00:00:00 2001 From: dabziuebu4egh2 <159787696+dabziuebu4egh2@users.noreply.github.com> Date: Mon, 16 Dec 2024 08:51:16 +0100 Subject: [PATCH 5/6] Update go.yml --- .github/workflows/go.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8d62e09..d1bab63 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -28,12 +28,7 @@ jobs: run: | cd v2 go build -o cook ./cmd/cook - - - name: Test - run: | - cd v2 - go test -v ./... -cover - + - name: Create Release id: create_release uses: softprops/action-gh-release@v1 From 02b621c596f19deee3c99729c76f1da852d54389 Mon Sep 17 00:00:00 2001 From: dabziuebu4egh2 <159787696+dabziuebu4egh2@users.noreply.github.com> Date: Mon, 16 Dec 2024 08:52:29 +0100 Subject: [PATCH 6/6] Update go.yml --- .github/workflows/go.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index d1bab63..77499a3 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -30,10 +30,11 @@ jobs: go build -o cook ./cmd/cook - name: Create Release + if: startsWith(github.ref, 'refs/tags/') id: create_release uses: softprops/action-gh-release@v1 with: tag: ${{ github.ref }} - files: cook + files: v2/cook env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}