From 7a01292d1c36f2667da0127857712dc6c7d4ac21 Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Tue, 25 Jun 2024 15:12:02 +0200 Subject: [PATCH 01/11] Try building go with ko --- .forgejo/workflows/demo.yaml | 13 ++++++++++++- go.mod | 3 +++ main.go | 9 +++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 go.mod create mode 100644 main.go diff --git a/.forgejo/workflows/demo.yaml b/.forgejo/workflows/demo.yaml index d470cda..a947c9d 100644 --- a/.forgejo/workflows/demo.yaml +++ b/.forgejo/workflows/demo.yaml @@ -1,6 +1,17 @@ -on: [push] +on: + push: + pull_request: + types: [opened, synchronize, reopened] jobs: test: runs-on: docker steps: + - uses: https://code.forgejo.org/actions/checkout@v4 + - uses: https://github.com/actions/setup-go@v5 + with: + go-version: '1.22.4' - run: echo All Good + - uses: https://github.com/ko-build/setup-ko@v0.7 + - run: ko build + env: + KO_DOCKER_REPO: ko.local diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..bc276e2 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module testgo + +go 1.22.4 diff --git a/main.go b/main.go new file mode 100644 index 0000000..28f37e0 --- /dev/null +++ b/main.go @@ -0,0 +1,9 @@ +package main + +import ( + "fmt" +) + +func main() { + fmt.Println("hello") +} -- 2.43.4 From 34f378dafd5d08df5fb816b69e67c2abb1c71192 Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Tue, 25 Jun 2024 15:19:56 +0200 Subject: [PATCH 02/11] Try using another image for building A missing "jq" is stopping setup-ko --- .forgejo/workflows/demo.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/demo.yaml b/.forgejo/workflows/demo.yaml index a947c9d..3f6b63e 100644 --- a/.forgejo/workflows/demo.yaml +++ b/.forgejo/workflows/demo.yaml @@ -4,7 +4,7 @@ on: types: [opened, synchronize, reopened] jobs: test: - runs-on: docker + runs-on: ubuntu-22.04 steps: - uses: https://code.forgejo.org/actions/checkout@v4 - uses: https://github.com/actions/setup-go@v5 -- 2.43.4 From c22163fdef243e83e8b5b11e807b43ab74e8d2e4 Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Thu, 27 Jun 2024 07:52:00 +0200 Subject: [PATCH 03/11] Try setting specific version --- .forgejo/workflows/demo.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.forgejo/workflows/demo.yaml b/.forgejo/workflows/demo.yaml index 3f6b63e..bf5209e 100644 --- a/.forgejo/workflows/demo.yaml +++ b/.forgejo/workflows/demo.yaml @@ -12,6 +12,8 @@ jobs: go-version: '1.22.4' - run: echo All Good - uses: https://github.com/ko-build/setup-ko@v0.7 + with: + version: v0.15.4 - run: ko build env: KO_DOCKER_REPO: ko.local -- 2.43.4 From 5d94746501583f2d6f0ae6c57114e04bfd96d3a6 Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Thu, 27 Jun 2024 08:15:11 +0200 Subject: [PATCH 04/11] Try building without version again --- .forgejo/workflows/demo.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.forgejo/workflows/demo.yaml b/.forgejo/workflows/demo.yaml index bf5209e..3f6b63e 100644 --- a/.forgejo/workflows/demo.yaml +++ b/.forgejo/workflows/demo.yaml @@ -12,8 +12,6 @@ jobs: go-version: '1.22.4' - run: echo All Good - uses: https://github.com/ko-build/setup-ko@v0.7 - with: - version: v0.15.4 - run: ko build env: KO_DOCKER_REPO: ko.local -- 2.43.4 From e1ec765975f70370d11f239466951d1bb43f945a Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Thu, 27 Jun 2024 09:09:07 +0200 Subject: [PATCH 05/11] Test another build --- .forgejo/workflows/demo.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.forgejo/workflows/demo.yaml b/.forgejo/workflows/demo.yaml index 3f6b63e..f76a566 100644 --- a/.forgejo/workflows/demo.yaml +++ b/.forgejo/workflows/demo.yaml @@ -15,3 +15,4 @@ jobs: - run: ko build env: KO_DOCKER_REPO: ko.local + -- 2.43.4 From 28a8f6b6ad6bd1fdec8b0b4f3dfe10496fdb24a9 Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Thu, 27 Jun 2024 09:36:10 +0200 Subject: [PATCH 06/11] Build again --- .forgejo/workflows/demo.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.forgejo/workflows/demo.yaml b/.forgejo/workflows/demo.yaml index f76a566..3f6b63e 100644 --- a/.forgejo/workflows/demo.yaml +++ b/.forgejo/workflows/demo.yaml @@ -15,4 +15,3 @@ jobs: - run: ko build env: KO_DOCKER_REPO: ko.local - -- 2.43.4 From 7515865cc472d830437631698c15b7dd93416693 Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Thu, 27 Jun 2024 10:01:07 +0200 Subject: [PATCH 07/11] Revert "Try building without version again" This reverts commit 5d94746501583f2d6f0ae6c57114e04bfd96d3a6. --- .forgejo/workflows/demo.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.forgejo/workflows/demo.yaml b/.forgejo/workflows/demo.yaml index 3f6b63e..bf5209e 100644 --- a/.forgejo/workflows/demo.yaml +++ b/.forgejo/workflows/demo.yaml @@ -12,6 +12,8 @@ jobs: go-version: '1.22.4' - run: echo All Good - uses: https://github.com/ko-build/setup-ko@v0.7 + with: + version: v0.15.4 - run: ko build env: KO_DOCKER_REPO: ko.local -- 2.43.4 From 03e0cd6f339840e71e078003724394ac91f5bec7 Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Thu, 27 Jun 2024 15:21:02 +0200 Subject: [PATCH 08/11] Try to push container to sunet-cdn org --- .forgejo/workflows/demo.yaml | 7 ++++--- go.mod | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/demo.yaml b/.forgejo/workflows/demo.yaml index bf5209e..02a8f46 100644 --- a/.forgejo/workflows/demo.yaml +++ b/.forgejo/workflows/demo.yaml @@ -10,10 +10,11 @@ jobs: - uses: https://github.com/actions/setup-go@v5 with: go-version: '1.22.4' - - run: echo All Good - uses: https://github.com/ko-build/setup-ko@v0.7 with: version: v0.15.4 - - run: ko build + - run: | + echo "${{ secrets.CI_SUNET_CDN }}" | ko login https://platform.sunet.se --username ci-sunet-cdn --password-stdin + ko build env: - KO_DOCKER_REPO: ko.local + KO_DOCKER_REPO: platform.sunet.se/sunet-cdn diff --git a/go.mod b/go.mod index bc276e2..4cbd61a 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module testgo +module action-runner-testgo go 1.22.4 -- 2.43.4 From b4c596fc1fa57d8fbc6d33bf73bc0e0584d4178c Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Thu, 27 Jun 2024 15:29:27 +0200 Subject: [PATCH 09/11] See if it is correctly substituted when not doing echo --- .forgejo/workflows/demo.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/demo.yaml b/.forgejo/workflows/demo.yaml index 02a8f46..5128a12 100644 --- a/.forgejo/workflows/demo.yaml +++ b/.forgejo/workflows/demo.yaml @@ -14,7 +14,7 @@ jobs: with: version: v0.15.4 - run: | - echo "${{ secrets.CI_SUNET_CDN }}" | ko login https://platform.sunet.se --username ci-sunet-cdn --password-stdin + ko login https://platform.sunet.se --username ci-sunet-cdn --password ${{ secrets.CI_SUNET_CDN }} ko build env: KO_DOCKER_REPO: platform.sunet.se/sunet-cdn -- 2.43.4 From 51ef79eb4b508477ea7481f610ee67e84514851b Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Thu, 27 Jun 2024 15:31:38 +0200 Subject: [PATCH 10/11] Try separate steps --- .forgejo/workflows/demo.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/demo.yaml b/.forgejo/workflows/demo.yaml index 5128a12..0b3df12 100644 --- a/.forgejo/workflows/demo.yaml +++ b/.forgejo/workflows/demo.yaml @@ -13,8 +13,7 @@ jobs: - uses: https://github.com/ko-build/setup-ko@v0.7 with: version: v0.15.4 - - run: | - ko login https://platform.sunet.se --username ci-sunet-cdn --password ${{ secrets.CI_SUNET_CDN }} - ko build + - run: ko login https://platform.sunet.se --username ci-sunet-cdn --password ${{ secrets.CI_SUNET_CDN }} + - run: ko build env: KO_DOCKER_REPO: platform.sunet.se/sunet-cdn -- 2.43.4 From c1f03a8ef0e36af7e8a1e6bfdbd67da72c376cb7 Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Fri, 28 Jun 2024 08:50:11 +0200 Subject: [PATCH 11/11] Test commit --- .forgejo/workflows/demo.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.forgejo/workflows/demo.yaml b/.forgejo/workflows/demo.yaml index 0b3df12..20cbf3a 100644 --- a/.forgejo/workflows/demo.yaml +++ b/.forgejo/workflows/demo.yaml @@ -17,3 +17,4 @@ jobs: - run: ko build env: KO_DOCKER_REPO: platform.sunet.se/sunet-cdn + -- 2.43.4