From d1ca7f1f5ea2103bc3e51be34c07087a6c28a09d Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 00:28:34 +0200 Subject: [PATCH 01/37] only run for PRs to main --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index abf10f1967..a544c607d0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,6 +5,8 @@ on: branches: - main pull_request: + branches: + - main jobs: lint: From c35264586a92f4af7da151aa46219814ef13d090 Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 00:30:11 +0200 Subject: [PATCH 02/37] using goreleaser --- .github/workflows/main.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a544c607d0..e22cd594c8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,3 +24,12 @@ jobs: uses: golangci/golangci-lint-action@v3 with: args: --print-issued-lines --config .golangci.yml -v + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + version: latest + args: release --clean + workdir: out + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 8bafa5c4d8d123117218239188485354bf9d26dd Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 11:01:08 +0200 Subject: [PATCH 03/37] updated main to use go releaser --- .github/workflows/main.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e22cd594c8..eabcc5be2a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,15 +13,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: 1.20.5 - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: args: --print-issued-lines --config .golangci.yml -v @@ -33,3 +33,9 @@ jobs: workdir: out env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: lava + path: out/* From c6f4d166cd8c967d2452170b7f880470e7e79a86 Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 11:08:39 +0200 Subject: [PATCH 04/37] remove working dir --- .github/workflows/main.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eabcc5be2a..9d61badd21 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,12 +30,11 @@ jobs: with: version: latest args: release --clean - workdir: out env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: lava - path: out/* + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: lava + # path: out/* From ce1e4ee2a77280276773f77f5ca1ff1d390b33a0 Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 11:12:00 +0200 Subject: [PATCH 05/37] fetch-depth: 0 --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9d61badd21..f980040fe3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,6 +19,8 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Lint uses: golangci/golangci-lint-action@v4 From 4455d4fb6314af4ab65a802fcc863873bbe46bd5 Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 22:30:46 +0200 Subject: [PATCH 06/37] adding goreleaser config files --- .github/workflows/main.yml | 11 +++++----- .gitignore | 2 ++ cmd/lavad/.goreleaser.yaml | 44 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 cmd/lavad/.goreleaser.yaml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f980040fe3..7fbf707b60 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,11 +32,12 @@ jobs: with: version: latest args: release --clean + workdir: cmd/lavad env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: lava - # path: out/* + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: lavad + path: cmd/lavad/dist/* diff --git a/.gitignore b/.gitignore index 2719be8dfd..701735eb0f 100644 --- a/.gitignore +++ b/.gitignore @@ -91,3 +91,5 @@ testutil/e2e/sdk/tests/node_modules.json config/health_examples/health_template_gen.yml # Yarn .yarn/ + +**/dist/ \ No newline at end of file diff --git a/cmd/lavad/.goreleaser.yaml b/cmd/lavad/.goreleaser.yaml new file mode 100644 index 0000000000..d3fb70f3b1 --- /dev/null +++ b/cmd/lavad/.goreleaser.yaml @@ -0,0 +1,44 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com + +# The lines bellow are called `modelines`. See `:help modeline` +# Feel free to remove those if you don't want/need to use them. +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +before: + hooks: + # You may remove this if you don't use go modules. + - go mod tidy + # you may remove this if you don't need go generate + - go generate ./... + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" From 34d3cc0f1bffcd576240e58c34b8384d48095f43 Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 22:37:32 +0200 Subject: [PATCH 07/37] added docker --- cmd/lavad/.goreleaser.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cmd/lavad/.goreleaser.yaml b/cmd/lavad/.goreleaser.yaml index d3fb70f3b1..03e6460933 100644 --- a/cmd/lavad/.goreleaser.yaml +++ b/cmd/lavad/.goreleaser.yaml @@ -20,6 +20,22 @@ builds: - linux - windows - darwin + goarch: + - amd64 + - arm64 + +dockers: + - image_templates: ["us-central1-docker.pkg.dev/lavanet/lavad:{{ .Version }}"] + dockerfile: Dockerfile + build_flag_templates: + - --label=org.opencontainers.image.title={{ .ProjectName }} + - --label=org.opencontainers.image.description={{ .ProjectName }} + - --label=org.opencontainers.image.url=https://github.com/lavanet/lava + - --label=org.opencontainers.image.source=https://github.com/lavanet/lava + - --label=org.opencontainers.image.version={{ .Version }} + - --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }} + - --label=org.opencontainers.image.revision={{ .FullCommit }} + - --label=org.opencontainers.image.licenses=Apache archives: - format: tar.gz From 4412a7e861cd5fc75979aad73197578da2bd6c09 Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 22:42:41 +0200 Subject: [PATCH 08/37] added config to lavap and visor --- cmd/lavap/.goreleaser.yaml | 60 ++++++++++++++++++++++++++++++++++ cmd/lavavisor/.goreleaser.yaml | 60 ++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 cmd/lavap/.goreleaser.yaml create mode 100644 cmd/lavavisor/.goreleaser.yaml diff --git a/cmd/lavap/.goreleaser.yaml b/cmd/lavap/.goreleaser.yaml new file mode 100644 index 0000000000..56f1663c30 --- /dev/null +++ b/cmd/lavap/.goreleaser.yaml @@ -0,0 +1,60 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com + +# The lines bellow are called `modelines`. See `:help modeline` +# Feel free to remove those if you don't want/need to use them. +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +before: + hooks: + # You may remove this if you don't use go modules. + - go mod tidy + # you may remove this if you don't need go generate + - go generate ./... + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + +dockers: + - image_templates: ["us-central1-docker.pkg.dev/lavanet/lavap:{{ .Version }}"] + dockerfile: Dockerfile + build_flag_templates: + - --label=org.opencontainers.image.title={{ .ProjectName }} + - --label=org.opencontainers.image.description={{ .ProjectName }} + - --label=org.opencontainers.image.url=https://github.com/lavanet/lava + - --label=org.opencontainers.image.source=https://github.com/lavanet/lava + - --label=org.opencontainers.image.version={{ .Version }} + - --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }} + - --label=org.opencontainers.image.revision={{ .FullCommit }} + - --label=org.opencontainers.image.licenses=Apache + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" diff --git a/cmd/lavavisor/.goreleaser.yaml b/cmd/lavavisor/.goreleaser.yaml new file mode 100644 index 0000000000..bcf5b43ddf --- /dev/null +++ b/cmd/lavavisor/.goreleaser.yaml @@ -0,0 +1,60 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com + +# The lines bellow are called `modelines`. See `:help modeline` +# Feel free to remove those if you don't want/need to use them. +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +before: + hooks: + # You may remove this if you don't use go modules. + - go mod tidy + # you may remove this if you don't need go generate + - go generate ./... + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + +dockers: + - image_templates: ["us-central1-docker.pkg.dev/lavanet/lavavisor:{{ .Version }}"] + dockerfile: Dockerfile + build_flag_templates: + - --label=org.opencontainers.image.title={{ .ProjectName }} + - --label=org.opencontainers.image.description={{ .ProjectName }} + - --label=org.opencontainers.image.url=https://github.com/lavanet/lava + - --label=org.opencontainers.image.source=https://github.com/lavanet/lava + - --label=org.opencontainers.image.version={{ .Version }} + - --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }} + - --label=org.opencontainers.image.revision={{ .FullCommit }} + - --label=org.opencontainers.image.licenses=Apache + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" From 98cf147f70be6b5239dcf4c6a5b7ce370cf7da0b Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 23:01:50 +0200 Subject: [PATCH 09/37] added nfpms --- cmd/lavad/.goreleaser.yaml | 6 +++++- cmd/lavap/.goreleaser.yaml | 6 +++++- cmd/lavavisor/.goreleaser.yaml | 9 ++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/cmd/lavad/.goreleaser.yaml b/cmd/lavad/.goreleaser.yaml index 03e6460933..3d1e6ad51d 100644 --- a/cmd/lavad/.goreleaser.yaml +++ b/cmd/lavad/.goreleaser.yaml @@ -33,9 +33,13 @@ dockers: - --label=org.opencontainers.image.url=https://github.com/lavanet/lava - --label=org.opencontainers.image.source=https://github.com/lavanet/lava - --label=org.opencontainers.image.version={{ .Version }} - - --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }} + - --label=org.opencontainers.image.created={{ .Date }} - --label=org.opencontainers.image.revision={{ .FullCommit }} - --label=org.opencontainers.image.licenses=Apache + - "--build-arg=LAVA_BINARY=lavad" + +nfpms: + - id: lavad archives: - format: tar.gz diff --git a/cmd/lavap/.goreleaser.yaml b/cmd/lavap/.goreleaser.yaml index 56f1663c30..04442f9780 100644 --- a/cmd/lavap/.goreleaser.yaml +++ b/cmd/lavap/.goreleaser.yaml @@ -33,9 +33,13 @@ dockers: - --label=org.opencontainers.image.url=https://github.com/lavanet/lava - --label=org.opencontainers.image.source=https://github.com/lavanet/lava - --label=org.opencontainers.image.version={{ .Version }} - - --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }} + - --label=org.opencontainers.image.created={{ .Date }} - --label=org.opencontainers.image.revision={{ .FullCommit }} - --label=org.opencontainers.image.licenses=Apache + - "--build-arg=LAVA_BINARY=lavap" + +nfpms: + - id: lavap archives: - format: tar.gz diff --git a/cmd/lavavisor/.goreleaser.yaml b/cmd/lavavisor/.goreleaser.yaml index bcf5b43ddf..92ed2f3b9a 100644 --- a/cmd/lavavisor/.goreleaser.yaml +++ b/cmd/lavavisor/.goreleaser.yaml @@ -33,10 +33,13 @@ dockers: - --label=org.opencontainers.image.url=https://github.com/lavanet/lava - --label=org.opencontainers.image.source=https://github.com/lavanet/lava - --label=org.opencontainers.image.version={{ .Version }} - - --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }} + - --label=org.opencontainers.image.created={{ .Date }} - --label=org.opencontainers.image.revision={{ .FullCommit }} - --label=org.opencontainers.image.licenses=Apache +nfpms: + - id: lavavisor + archives: - format: tar.gz # this name template makes the OS and Arch compatible with the results of `uname`. @@ -52,6 +55,10 @@ archives: - goos: windows format: zip +checksum: + name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' + algorithm: sha256 + changelog: sort: asc filters: From e73568ded6a261eb847be938e5aa5370822be40f Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 23:08:11 +0200 Subject: [PATCH 10/37] added id and binary --- cmd/lavad/.goreleaser.yaml | 8 +++++--- cmd/lavap/.goreleaser.yaml | 8 +++++--- cmd/lavavisor/.goreleaser.yaml | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/cmd/lavad/.goreleaser.yaml b/cmd/lavad/.goreleaser.yaml index 3d1e6ad51d..44c50685b7 100644 --- a/cmd/lavad/.goreleaser.yaml +++ b/cmd/lavad/.goreleaser.yaml @@ -14,7 +14,9 @@ before: - go generate ./... builds: - - env: + - id: lavad + binary: lavad + env: - CGO_ENABLED=0 goos: - linux @@ -38,8 +40,8 @@ dockers: - --label=org.opencontainers.image.licenses=Apache - "--build-arg=LAVA_BINARY=lavad" -nfpms: - - id: lavad +# nfpms: +# - id: lavad archives: - format: tar.gz diff --git a/cmd/lavap/.goreleaser.yaml b/cmd/lavap/.goreleaser.yaml index 04442f9780..27d1d6281c 100644 --- a/cmd/lavap/.goreleaser.yaml +++ b/cmd/lavap/.goreleaser.yaml @@ -14,7 +14,9 @@ before: - go generate ./... builds: - - env: + - id: lavap + binary: lavap + env: - CGO_ENABLED=0 goos: - linux @@ -38,8 +40,8 @@ dockers: - --label=org.opencontainers.image.licenses=Apache - "--build-arg=LAVA_BINARY=lavap" -nfpms: - - id: lavap +# nfpms: +# - id: lavap archives: - format: tar.gz diff --git a/cmd/lavavisor/.goreleaser.yaml b/cmd/lavavisor/.goreleaser.yaml index 92ed2f3b9a..fc632e4cf0 100644 --- a/cmd/lavavisor/.goreleaser.yaml +++ b/cmd/lavavisor/.goreleaser.yaml @@ -14,7 +14,9 @@ before: - go generate ./... builds: - - env: + - id: lavavisor + binary: lavavisor + env: - CGO_ENABLED=0 goos: - linux @@ -37,8 +39,8 @@ dockers: - --label=org.opencontainers.image.revision={{ .FullCommit }} - --label=org.opencontainers.image.licenses=Apache -nfpms: - - id: lavavisor +# nfpms: +# - id: lavavisor archives: - format: tar.gz From 9615e764aa935b4dbcccb8b7c0494cdae0d1343e Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 23:08:42 +0200 Subject: [PATCH 11/37] update pipeline --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7fbf707b60..6221da160e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: uses: goreleaser/goreleaser-action@v5 with: version: latest - args: release --clean + args: build --single-target --skip-validate --snapshot --clean workdir: cmd/lavad env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From f1471b699187246bebe75e5426fe724ee182d3a8 Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 23:14:20 +0200 Subject: [PATCH 12/37] --skip=validate --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6221da160e..89f463b4a1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: uses: goreleaser/goreleaser-action@v5 with: version: latest - args: build --single-target --skip-validate --snapshot --clean + args: build --single-target --skip=validate --snapshot --clean workdir: cmd/lavad env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 11a72622158178c201384a7934376b5a30590308 Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 23:17:19 +0200 Subject: [PATCH 13/37] no need for both snapshot and skip --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89f463b4a1..1aa382eb16 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: uses: goreleaser/goreleaser-action@v5 with: version: latest - args: build --single-target --skip=validate --snapshot --clean + args: build --single-target --snapshot --clean workdir: cmd/lavad env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c7849ab0b519a2c6ad06afeb26b795594766f36e Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 23:19:14 +0200 Subject: [PATCH 14/37] use: buildx --- cmd/lavad/.goreleaser.yaml | 7 +++++-- cmd/lavap/.goreleaser.yaml | 1 + cmd/lavavisor/.goreleaser.yaml | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/lavad/.goreleaser.yaml b/cmd/lavad/.goreleaser.yaml index 44c50685b7..30d3796d50 100644 --- a/cmd/lavad/.goreleaser.yaml +++ b/cmd/lavad/.goreleaser.yaml @@ -29,6 +29,7 @@ builds: dockers: - image_templates: ["us-central1-docker.pkg.dev/lavanet/lavad:{{ .Version }}"] dockerfile: Dockerfile + use: buildx build_flag_templates: - --label=org.opencontainers.image.title={{ .ProjectName }} - --label=org.opencontainers.image.description={{ .ProjectName }} @@ -40,8 +41,10 @@ dockers: - --label=org.opencontainers.image.licenses=Apache - "--build-arg=LAVA_BINARY=lavad" -# nfpms: -# - id: lavad +nfpms: + - id: lavad + maintainer: Amit + archives: - format: tar.gz diff --git a/cmd/lavap/.goreleaser.yaml b/cmd/lavap/.goreleaser.yaml index 27d1d6281c..43544e2c1e 100644 --- a/cmd/lavap/.goreleaser.yaml +++ b/cmd/lavap/.goreleaser.yaml @@ -29,6 +29,7 @@ builds: dockers: - image_templates: ["us-central1-docker.pkg.dev/lavanet/lavap:{{ .Version }}"] dockerfile: Dockerfile + use: buildx build_flag_templates: - --label=org.opencontainers.image.title={{ .ProjectName }} - --label=org.opencontainers.image.description={{ .ProjectName }} diff --git a/cmd/lavavisor/.goreleaser.yaml b/cmd/lavavisor/.goreleaser.yaml index fc632e4cf0..658f7b3c96 100644 --- a/cmd/lavavisor/.goreleaser.yaml +++ b/cmd/lavavisor/.goreleaser.yaml @@ -29,6 +29,7 @@ builds: dockers: - image_templates: ["us-central1-docker.pkg.dev/lavanet/lavavisor:{{ .Version }}"] dockerfile: Dockerfile + use: buildx build_flag_templates: - --label=org.opencontainers.image.title={{ .ProjectName }} - --label=org.opencontainers.image.description={{ .ProjectName }} From eaa9f79c705d80e4fe5a6a3d379f0488a4f26329 Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 23:25:48 +0200 Subject: [PATCH 15/37] update config --- cmd/lavad/.goreleaser.yaml | 7 +++++++ cmd/lavap/.goreleaser.yaml | 12 ++++++++++-- cmd/lavavisor/.goreleaser.yaml | 8 ++++++-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/cmd/lavad/.goreleaser.yaml b/cmd/lavad/.goreleaser.yaml index 30d3796d50..e5be770fe1 100644 --- a/cmd/lavad/.goreleaser.yaml +++ b/cmd/lavad/.goreleaser.yaml @@ -61,6 +61,13 @@ archives: - goos: windows format: zip +checksum: + name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' + algorithm: sha256 + +sboms: + - artifacts: archive + changelog: sort: asc filters: diff --git a/cmd/lavap/.goreleaser.yaml b/cmd/lavap/.goreleaser.yaml index 43544e2c1e..f08dc96fc9 100644 --- a/cmd/lavap/.goreleaser.yaml +++ b/cmd/lavap/.goreleaser.yaml @@ -41,8 +41,9 @@ dockers: - --label=org.opencontainers.image.licenses=Apache - "--build-arg=LAVA_BINARY=lavap" -# nfpms: -# - id: lavap +nfpms: + - id: lavap + maintainer: Amit archives: - format: tar.gz @@ -59,6 +60,13 @@ archives: - goos: windows format: zip +checksum: + name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' + algorithm: sha256 + +sboms: + - artifacts: archive + changelog: sort: asc filters: diff --git a/cmd/lavavisor/.goreleaser.yaml b/cmd/lavavisor/.goreleaser.yaml index 658f7b3c96..1571c2eda6 100644 --- a/cmd/lavavisor/.goreleaser.yaml +++ b/cmd/lavavisor/.goreleaser.yaml @@ -40,8 +40,9 @@ dockers: - --label=org.opencontainers.image.revision={{ .FullCommit }} - --label=org.opencontainers.image.licenses=Apache -# nfpms: -# - id: lavavisor +nfpms: + - id: lavavisor + maintainer: Amit archives: - format: tar.gz @@ -62,6 +63,9 @@ checksum: name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' algorithm: sha256 +sboms: + - artifacts: archive + changelog: sort: asc filters: From 6427be2214f6d34e70e3ab778ae1a4d904986910 Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 23:47:22 +0200 Subject: [PATCH 16/37] rename workflow files --- .github/workflows/{main.yml => ci.yml} | 7 +------ .github/workflows/lint.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 6 deletions(-) rename .github/workflows/{main.yml => ci.yml} (82%) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/main.yml b/.github/workflows/ci.yml similarity index 82% rename from .github/workflows/main.yml rename to .github/workflows/ci.yml index 1aa382eb16..de5fcc2978 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Lint +name: CI on: push: @@ -22,11 +22,6 @@ jobs: with: fetch-depth: 0 - - name: Lint - uses: golangci/golangci-lint-action@v4 - with: - args: --print-issued-lines --config .golangci.yml -v - - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..932e04cecb --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,26 @@ +name: Lint + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: 1.20.5 + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Lint + uses: golangci/golangci-lint-action@v4 + with: + args: --print-issued-lines --config .golangci.yml -v \ No newline at end of file From 1bff9b313a658917a8937a2ad843be3e46f35c7b Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 23:47:45 +0200 Subject: [PATCH 17/37] update job name --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de5fcc2978..12249880d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ on: - main jobs: - lint: + ci: runs-on: ubuntu-latest steps: - name: Install Go From 7eccc0a0b87415b73c89a3fb71661292abf1931f Mon Sep 17 00:00:00 2001 From: amitz Date: Sun, 17 Mar 2024 23:49:13 +0200 Subject: [PATCH 18/37] matrix strategy --- .github/workflows/ci.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12249880d4..6dae1116e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,9 @@ on: jobs: ci: runs-on: ubuntu-latest + strategy: + matrix: + binary: [lavad, lavap, lavavisor] steps: - name: Install Go uses: actions/setup-go@v5 @@ -27,12 +30,12 @@ jobs: with: version: latest args: build --single-target --snapshot --clean - workdir: cmd/lavad + workdir: cmd/${{ matrix.binary }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload Artifacts uses: actions/upload-artifact@v4 with: - name: lavad - path: cmd/lavad/dist/* + name: ${{ matrix.binary }} + path: cmd/${{ matrix.binary }}/dist/* From 75707fcdf47058d5f748c0c38abb8525fdfd214f Mon Sep 17 00:00:00 2001 From: amitz Date: Mon, 18 Mar 2024 14:00:30 +0200 Subject: [PATCH 19/37] running on macos as well --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6dae1116e7..b4f4fd3abf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,10 +10,11 @@ on: jobs: ci: - runs-on: ubuntu-latest strategy: matrix: binary: [lavad, lavap, lavavisor] + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} steps: - name: Install Go uses: actions/setup-go@v5 From fbea05241dfc33e09f82bebe7e8ff83ceb2c4fc7 Mon Sep 17 00:00:00 2001 From: amitz Date: Mon, 18 Mar 2024 15:44:45 +0200 Subject: [PATCH 20/37] artifact names --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4f4fd3abf..dcf9d177c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,7 @@ jobs: fetch-depth: 0 - name: Run GoReleaser + id: releaser uses: goreleaser/goreleaser-action@v5 with: version: latest @@ -38,5 +39,5 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v4 with: - name: ${{ matrix.binary }} + name: ${{ steps.releaser.outputs.metadata.runtime.goos }}-${{ steps.releaser.outputs.metadata.tag }}-${{ steps.releaser.outputs.metadata.runtime.goarch }} path: cmd/${{ matrix.binary }}/dist/* From 0495e69ae3f4a62f0136bd123fb9cf2e30ab8132 Mon Sep 17 00:00:00 2001 From: amitz Date: Mon, 18 Mar 2024 15:51:31 +0200 Subject: [PATCH 21/37] fronJson --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcf9d177c7..7c1d7593b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,5 +39,5 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v4 with: - name: ${{ steps.releaser.outputs.metadata.runtime.goos }}-${{ steps.releaser.outputs.metadata.tag }}-${{ steps.releaser.outputs.metadata.runtime.goarch }} + name: ${{ fromJson(steps.releaser.outputs.metadata).runtime.goos }}-${{ fromJson(steps.releaser.outputs.metadata).tag }}-${{ fromJson(steps.releaser.outputs.metadata).runtime.goarch }} path: cmd/${{ matrix.binary }}/dist/* From 400d54c22afb10213185e63bbb23692b90624800 Mon Sep 17 00:00:00 2001 From: amitz Date: Mon, 18 Mar 2024 15:58:08 +0200 Subject: [PATCH 22/37] naming --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c1d7593b1..718b6601fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,5 +39,5 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v4 with: - name: ${{ fromJson(steps.releaser.outputs.metadata).runtime.goos }}-${{ fromJson(steps.releaser.outputs.metadata).tag }}-${{ fromJson(steps.releaser.outputs.metadata).runtime.goarch }} + name: ${{ matrix.binary }}-${{ fromJson(steps.releaser.outputs.metadata).tag }}-${{ fromJson(steps.releaser.outputs.metadata).runtime.goos }}-${{ fromJson(steps.releaser.outputs.metadata).runtime.goarch }} path: cmd/${{ matrix.binary }}/dist/* From 5f27d011fbc3b4ad7c1dda5af923572880dd4518 Mon Sep 17 00:00:00 2001 From: amitz Date: Mon, 18 Mar 2024 16:11:48 +0200 Subject: [PATCH 23/37] windows-latest --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 718b6601fd..23198b2eee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: binary: [lavad, lavap, lavavisor] - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - name: Install Go From f358c7f37049c482ecaf8716aceea36e42d99ac6 Mon Sep 17 00:00:00 2001 From: amitz Date: Mon, 18 Mar 2024 23:19:39 +0200 Subject: [PATCH 24/37] update goreleasr files --- cmd/lavad/.goreleaser.yaml | 30 ++++++++++++------------------ cmd/lavap/.goreleaser.yaml | 29 ++++++++++++----------------- cmd/lavavisor/.goreleaser.yaml | 28 ++++++++++++---------------- 3 files changed, 36 insertions(+), 51 deletions(-) diff --git a/cmd/lavad/.goreleaser.yaml b/cmd/lavad/.goreleaser.yaml index e5be770fe1..da108ff1b1 100644 --- a/cmd/lavad/.goreleaser.yaml +++ b/cmd/lavad/.goreleaser.yaml @@ -5,7 +5,7 @@ # Feel free to remove those if you don't want/need to use them. # yaml-language-server: $schema=https://goreleaser.com/static/schema.json # vim: set ts=2 sw=2 tw=0 fo=cnqoj - +project_name: lavad before: hooks: # You may remove this if you don't use go modules. @@ -15,7 +15,6 @@ before: builds: - id: lavad - binary: lavad env: - CGO_ENABLED=0 goos: @@ -25,27 +24,22 @@ builds: goarch: - amd64 - arm64 - -dockers: - - image_templates: ["us-central1-docker.pkg.dev/lavanet/lavad:{{ .Version }}"] - dockerfile: Dockerfile - use: buildx - build_flag_templates: - - --label=org.opencontainers.image.title={{ .ProjectName }} - - --label=org.opencontainers.image.description={{ .ProjectName }} - - --label=org.opencontainers.image.url=https://github.com/lavanet/lava - - --label=org.opencontainers.image.source=https://github.com/lavanet/lava - - --label=org.opencontainers.image.version={{ .Version }} - - --label=org.opencontainers.image.created={{ .Date }} - - --label=org.opencontainers.image.revision={{ .FullCommit }} - - --label=org.opencontainers.image.licenses=Apache - - "--build-arg=LAVA_BINARY=lavad" + ignore: + - goos: darwin + goarch: s390x + - goos: darwin + goarch: ppc64le + - goos: windows + goarch: s390x + - goos: windows + goarch: ppc64le + - goos: windows + goarch: arm64 nfpms: - id: lavad maintainer: Amit - archives: - format: tar.gz # this name template makes the OS and Arch compatible with the results of `uname`. diff --git a/cmd/lavap/.goreleaser.yaml b/cmd/lavap/.goreleaser.yaml index f08dc96fc9..613def554c 100644 --- a/cmd/lavap/.goreleaser.yaml +++ b/cmd/lavap/.goreleaser.yaml @@ -5,7 +5,7 @@ # Feel free to remove those if you don't want/need to use them. # yaml-language-server: $schema=https://goreleaser.com/static/schema.json # vim: set ts=2 sw=2 tw=0 fo=cnqoj - +project_name: lavap before: hooks: # You may remove this if you don't use go modules. @@ -15,7 +15,6 @@ before: builds: - id: lavap - binary: lavap env: - CGO_ENABLED=0 goos: @@ -25,21 +24,17 @@ builds: goarch: - amd64 - arm64 - -dockers: - - image_templates: ["us-central1-docker.pkg.dev/lavanet/lavap:{{ .Version }}"] - dockerfile: Dockerfile - use: buildx - build_flag_templates: - - --label=org.opencontainers.image.title={{ .ProjectName }} - - --label=org.opencontainers.image.description={{ .ProjectName }} - - --label=org.opencontainers.image.url=https://github.com/lavanet/lava - - --label=org.opencontainers.image.source=https://github.com/lavanet/lava - - --label=org.opencontainers.image.version={{ .Version }} - - --label=org.opencontainers.image.created={{ .Date }} - - --label=org.opencontainers.image.revision={{ .FullCommit }} - - --label=org.opencontainers.image.licenses=Apache - - "--build-arg=LAVA_BINARY=lavap" + ignore: + - goos: darwin + goarch: s390x + - goos: darwin + goarch: ppc64le + - goos: windows + goarch: s390x + - goos: windows + goarch: ppc64le + - goos: windows + goarch: arm64 nfpms: - id: lavap diff --git a/cmd/lavavisor/.goreleaser.yaml b/cmd/lavavisor/.goreleaser.yaml index 1571c2eda6..170a59fa6c 100644 --- a/cmd/lavavisor/.goreleaser.yaml +++ b/cmd/lavavisor/.goreleaser.yaml @@ -5,7 +5,7 @@ # Feel free to remove those if you don't want/need to use them. # yaml-language-server: $schema=https://goreleaser.com/static/schema.json # vim: set ts=2 sw=2 tw=0 fo=cnqoj - +project_name: lavavisor before: hooks: # You may remove this if you don't use go modules. @@ -15,7 +15,6 @@ before: builds: - id: lavavisor - binary: lavavisor env: - CGO_ENABLED=0 goos: @@ -25,20 +24,17 @@ builds: goarch: - amd64 - arm64 - -dockers: - - image_templates: ["us-central1-docker.pkg.dev/lavanet/lavavisor:{{ .Version }}"] - dockerfile: Dockerfile - use: buildx - build_flag_templates: - - --label=org.opencontainers.image.title={{ .ProjectName }} - - --label=org.opencontainers.image.description={{ .ProjectName }} - - --label=org.opencontainers.image.url=https://github.com/lavanet/lava - - --label=org.opencontainers.image.source=https://github.com/lavanet/lava - - --label=org.opencontainers.image.version={{ .Version }} - - --label=org.opencontainers.image.created={{ .Date }} - - --label=org.opencontainers.image.revision={{ .FullCommit }} - - --label=org.opencontainers.image.licenses=Apache + ignore: + - goos: darwin + goarch: s390x + - goos: darwin + goarch: ppc64le + - goos: windows + goarch: s390x + - goos: windows + goarch: ppc64le + - goos: windows + goarch: arm64 nfpms: - id: lavavisor From 3f116184de5b85059a112a2ef2608de56ede2975 Mon Sep 17 00:00:00 2001 From: amitz Date: Mon, 18 Mar 2024 23:23:41 +0200 Subject: [PATCH 25/37] update releaser files --- cmd/lavad/.goreleaser.yaml | 26 +++++++++++++++++++++----- cmd/lavap/.goreleaser.yaml | 26 +++++++++++++++++++++----- cmd/lavavisor/.goreleaser.yaml | 26 +++++++++++++++++++++----- 3 files changed, 63 insertions(+), 15 deletions(-) diff --git a/cmd/lavad/.goreleaser.yaml b/cmd/lavad/.goreleaser.yaml index da108ff1b1..e9cf45cdba 100644 --- a/cmd/lavad/.goreleaser.yaml +++ b/cmd/lavad/.goreleaser.yaml @@ -59,12 +59,28 @@ checksum: name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' algorithm: sha256 -sboms: - - artifacts: archive - changelog: + use: + github sort: asc + abbrev: 0 + groups: # Regex use RE2 syntax as defined here: https://github.com/google/re2/wiki/Syntax. + - title: 'Features' + regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$' + order: 100 + - title: 'Bug fixes' + regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$' + order: 200 + - title: 'Documentation' + regexp: '^.*?docs(\([[:word:]]+\))??!?:.+$' + order: 300 + - title: 'Dependency updates' + regexp: '^.*?(feat|fix|chore)\(deps?.+\)!?:.+$' + order: 400 + - title: 'Other work' + order: 999 filters: exclude: - - "^docs:" - - "^test:" + - '^test:' + - '^.*?Bump(\([[:word:]]+\))?.+$' + - '^.*?[Bot](\([[:word:]]+\))?.+$' diff --git a/cmd/lavap/.goreleaser.yaml b/cmd/lavap/.goreleaser.yaml index 613def554c..a6f589969b 100644 --- a/cmd/lavap/.goreleaser.yaml +++ b/cmd/lavap/.goreleaser.yaml @@ -59,12 +59,28 @@ checksum: name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' algorithm: sha256 -sboms: - - artifacts: archive - changelog: + use: + github sort: asc + abbrev: 0 + groups: # Regex use RE2 syntax as defined here: https://github.com/google/re2/wiki/Syntax. + - title: 'Features' + regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$' + order: 100 + - title: 'Bug fixes' + regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$' + order: 200 + - title: 'Documentation' + regexp: '^.*?docs(\([[:word:]]+\))??!?:.+$' + order: 300 + - title: 'Dependency updates' + regexp: '^.*?(feat|fix|chore)\(deps?.+\)!?:.+$' + order: 400 + - title: 'Other work' + order: 999 filters: exclude: - - "^docs:" - - "^test:" + - '^test:' + - '^.*?Bump(\([[:word:]]+\))?.+$' + - '^.*?[Bot](\([[:word:]]+\))?.+$' diff --git a/cmd/lavavisor/.goreleaser.yaml b/cmd/lavavisor/.goreleaser.yaml index 170a59fa6c..9ec13b5980 100644 --- a/cmd/lavavisor/.goreleaser.yaml +++ b/cmd/lavavisor/.goreleaser.yaml @@ -59,12 +59,28 @@ checksum: name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' algorithm: sha256 -sboms: - - artifacts: archive - changelog: + use: + github sort: asc + abbrev: 0 + groups: # Regex use RE2 syntax as defined here: https://github.com/google/re2/wiki/Syntax. + - title: 'Features' + regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$' + order: 100 + - title: 'Bug fixes' + regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$' + order: 200 + - title: 'Documentation' + regexp: '^.*?docs(\([[:word:]]+\))??!?:.+$' + order: 300 + - title: 'Dependency updates' + regexp: '^.*?(feat|fix|chore)\(deps?.+\)!?:.+$' + order: 400 + - title: 'Other work' + order: 999 filters: exclude: - - "^docs:" - - "^test:" + - '^test:' + - '^.*?Bump(\([[:word:]]+\))?.+$' + - '^.*?[Bot](\([[:word:]]+\))?.+$' \ No newline at end of file From 2671f1ac3ba5079c64ba32a572dbe5692119f39a Mon Sep 17 00:00:00 2001 From: Amit Zafran Date: Mon, 25 Mar 2024 11:09:36 +0200 Subject: [PATCH 26/37] single goreleaser file --- .github/workflows/ci.yml | 19 ++-- .../.goreleaser.yaml => .goreleaser.yaml | 58 +++++++++++- cmd/lavad/.goreleaser.yaml | 94 ------------------- cmd/lavap/.goreleaser.yaml | 94 ------------------- 4 files changed, 64 insertions(+), 201 deletions(-) rename cmd/lavavisor/.goreleaser.yaml => .goreleaser.yaml (70%) delete mode 100644 cmd/lavad/.goreleaser.yaml delete mode 100644 cmd/lavap/.goreleaser.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23198b2eee..571fd9b6ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,11 +10,7 @@ on: jobs: ci: - strategy: - matrix: - binary: [lavad, lavap, lavavisor] - os: [ubuntu-latest, macos-latest, windows-latest] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - name: Install Go uses: actions/setup-go@v5 @@ -31,13 +27,12 @@ jobs: uses: goreleaser/goreleaser-action@v5 with: version: latest - args: build --single-target --snapshot --clean - workdir: cmd/${{ matrix.binary }} + args: build --snapshot --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.binary }}-${{ fromJson(steps.releaser.outputs.metadata).tag }}-${{ fromJson(steps.releaser.outputs.metadata).runtime.goos }}-${{ fromJson(steps.releaser.outputs.metadata).runtime.goarch }} - path: cmd/${{ matrix.binary }}/dist/* + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: ${{ matrix.binary }}-${{ fromJson(steps.releaser.outputs.metadata).tag }}-${{ fromJson(steps.releaser.outputs.metadata).runtime.goos }}-${{ fromJson(steps.releaser.outputs.metadata).runtime.goarch }} + # path: cmd/${{ matrix.binary }}/dist/* diff --git a/cmd/lavavisor/.goreleaser.yaml b/.goreleaser.yaml similarity index 70% rename from cmd/lavavisor/.goreleaser.yaml rename to .goreleaser.yaml index f3a17e0d92..5762208df1 100644 --- a/cmd/lavavisor/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -5,7 +5,7 @@ # Feel free to remove those if you don't want/need to use them. # yaml-language-server: $schema=https://goreleaser.com/static/schema.json # vim: set ts=2 sw=2 tw=0 fo=cnqoj -project_name: lavavisor +project_name: lava before: hooks: # You may remove this if you don't use go modules. @@ -15,6 +15,62 @@ before: builds: - id: lavavisor + binary: lavavisor + dir: lavavisor + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + ignore: + - goos: darwin + goarch: s390x + - goos: darwin + goarch: ppc64le + - goos: windows + goarch: s390x + - goos: windows + goarch: ppc64le + - goos: windows + goarch: arm64 + flags: + - -mod=readonly + - -trimpath + + - id: lavad + binary: lavad + dir: lavad + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + ignore: + - goos: darwin + goarch: s390x + - goos: darwin + goarch: ppc64le + - goos: windows + goarch: s390x + - goos: windows + goarch: ppc64le + - goos: windows + goarch: arm64 + flags: + - -mod=readonly + - -trimpath + + - id: lavap + binary: lavap + dir: lavap env: - CGO_ENABLED=0 goos: diff --git a/cmd/lavad/.goreleaser.yaml b/cmd/lavad/.goreleaser.yaml deleted file mode 100644 index e14f334c49..0000000000 --- a/cmd/lavad/.goreleaser.yaml +++ /dev/null @@ -1,94 +0,0 @@ -# This is an example .goreleaser.yml file with some sensible defaults. -# Make sure to check the documentation at https://goreleaser.com - -# The lines bellow are called `modelines`. See `:help modeline` -# Feel free to remove those if you don't want/need to use them. -# yaml-language-server: $schema=https://goreleaser.com/static/schema.json -# vim: set ts=2 sw=2 tw=0 fo=cnqoj -project_name: lavad -before: - hooks: - # You may remove this if you don't use go modules. - - go mod tidy - # you may remove this if you don't need go generate - - go generate ./... - -builds: - - id: lavad - env: - - CGO_ENABLED=0 - goos: - - linux - - windows - - darwin - goarch: - - amd64 - - arm64 - ignore: - - goos: darwin - goarch: s390x - - goos: darwin - goarch: ppc64le - - goos: windows - goarch: s390x - - goos: windows - goarch: ppc64le - - goos: windows - goarch: arm64 - flags: - - -mod=readonly - - -trimpath - -archives: - - format: tar.gz - # this name template makes the OS and Arch compatible with the results of `uname`. - name_template: >- - {{ .ProjectName }}_ - {{- title .Os }}_ - {{- if eq .Arch "amd64" }}x86_64 - {{- else if eq .Arch "386" }}i386 - {{- else }}{{ .Arch }}{{ end }} - {{- if .Arm }}v{{ .Arm }}{{ end }} - # use zip for windows archives - format_overrides: - - goos: windows - format: zip - -checksum: - name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' - algorithm: sha256 - -changelog: - use: - github - sort: asc - abbrev: 0 - groups: # Regex use RE2 syntax as defined here: https://github.com/google/re2/wiki/Syntax. - - title: 'Features' - regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$' - order: 100 - - title: 'Bug fixes' - regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$' - order: 200 - - title: 'Documentation' - regexp: '^.*?docs(\([[:word:]]+\))??!?:.+$' - order: 300 - - title: 'Dependency updates' - regexp: '^.*?(feat|fix|chore)\(deps?.+\)!?:.+$' - order: 400 - - title: 'Other work' - order: 999 - filters: - exclude: - - '^test:' - - '^.*?Bump(\([[:word:]]+\))?.+$' - - '^.*?[Bot](\([[:word:]]+\))?.+$' - -release: - github: - owner: lavanet - name: lava - replace_existing_draft: true - name_template: "Lava v{{.Version}} 🌋" - mode: replace - draft: true diff --git a/cmd/lavap/.goreleaser.yaml b/cmd/lavap/.goreleaser.yaml deleted file mode 100644 index f752582810..0000000000 --- a/cmd/lavap/.goreleaser.yaml +++ /dev/null @@ -1,94 +0,0 @@ -# This is an example .goreleaser.yml file with some sensible defaults. -# Make sure to check the documentation at https://goreleaser.com - -# The lines bellow are called `modelines`. See `:help modeline` -# Feel free to remove those if you don't want/need to use them. -# yaml-language-server: $schema=https://goreleaser.com/static/schema.json -# vim: set ts=2 sw=2 tw=0 fo=cnqoj -project_name: lavap -before: - hooks: - # You may remove this if you don't use go modules. - - go mod tidy - # you may remove this if you don't need go generate - - go generate ./... - -builds: - - id: lavap - env: - - CGO_ENABLED=0 - goos: - - linux - - windows - - darwin - goarch: - - amd64 - - arm64 - ignore: - - goos: darwin - goarch: s390x - - goos: darwin - goarch: ppc64le - - goos: windows - goarch: s390x - - goos: windows - goarch: ppc64le - - goos: windows - goarch: arm64 - flags: - - -mod=readonly - - -trimpath - -archives: - - format: tar.gz - # this name template makes the OS and Arch compatible with the results of `uname`. - name_template: >- - {{ .ProjectName }}_ - {{- title .Os }}_ - {{- if eq .Arch "amd64" }}x86_64 - {{- else if eq .Arch "386" }}i386 - {{- else }}{{ .Arch }}{{ end }} - {{- if .Arm }}v{{ .Arm }}{{ end }} - # use zip for windows archives - format_overrides: - - goos: windows - format: zip - -checksum: - name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' - algorithm: sha256 - -changelog: - use: - github - sort: asc - abbrev: 0 - groups: # Regex use RE2 syntax as defined here: https://github.com/google/re2/wiki/Syntax. - - title: 'Features' - regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$' - order: 100 - - title: 'Bug fixes' - regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$' - order: 200 - - title: 'Documentation' - regexp: '^.*?docs(\([[:word:]]+\))??!?:.+$' - order: 300 - - title: 'Dependency updates' - regexp: '^.*?(feat|fix|chore)\(deps?.+\)!?:.+$' - order: 400 - - title: 'Other work' - order: 999 - filters: - exclude: - - '^test:' - - '^.*?Bump(\([[:word:]]+\))?.+$' - - '^.*?[Bot](\([[:word:]]+\))?.+$' - -release: - github: - owner: lavanet - name: lava - replace_existing_draft: true - name_template: "Lava v{{.Version}} 🌋" - mode: replace - draft: true From 53544c28f8b702603a6ea7e2e92bc8998855983a Mon Sep 17 00:00:00 2001 From: Amit Zafran Date: Mon, 25 Mar 2024 11:11:46 +0200 Subject: [PATCH 27/37] cmd --- .goreleaser.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 5762208df1..ec42c2f749 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -16,7 +16,7 @@ before: builds: - id: lavavisor binary: lavavisor - dir: lavavisor + dir: cmd/lavavisor env: - CGO_ENABLED=0 goos: @@ -43,7 +43,7 @@ builds: - id: lavad binary: lavad - dir: lavad + dir: cmd/lavad env: - CGO_ENABLED=0 goos: @@ -70,7 +70,7 @@ builds: - id: lavap binary: lavap - dir: lavap + dir: cmd/lavap env: - CGO_ENABLED=0 goos: From e040e57c9175f5eaf0dca3d8838396e5d88aea18 Mon Sep 17 00:00:00 2001 From: Amit Zafran Date: Mon, 25 Mar 2024 11:45:29 +0200 Subject: [PATCH 28/37] upload pattern --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 571fd9b6ef..46f67baf05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,12 +27,12 @@ jobs: uses: goreleaser/goreleaser-action@v5 with: version: latest - args: build --snapshot --clean + args: build --snapshot env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: ${{ matrix.binary }}-${{ fromJson(steps.releaser.outputs.metadata).tag }}-${{ fromJson(steps.releaser.outputs.metadata).runtime.goos }}-${{ fromJson(steps.releaser.outputs.metadata).runtime.goarch }} - # path: cmd/${{ matrix.binary }}/dist/* + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: lava-binaries + path: dist/**/* From 18608573d8587d6f250be57f2db23d27a60bd878 Mon Sep 17 00:00:00 2001 From: Amit Zafran Date: Mon, 25 Mar 2024 11:46:21 +0200 Subject: [PATCH 29/37] cache --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46f67baf05..e6ed622ac0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,8 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: 1.20.5 + go-version-file: go.mod + cache-dependency-path: go.sum - name: Checkout code uses: actions/checkout@v4 From 94d632222f2dd3d52c69e13abb3c07cc5717eefa Mon Sep 17 00:00:00 2001 From: Amit Zafran Date: Mon, 25 Mar 2024 11:47:33 +0200 Subject: [PATCH 30/37] checkout first --- .github/workflows/ci.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6ed622ac0..f772debddc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,17 +12,15 @@ jobs: ci: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Go uses: actions/setup-go@v5 with: go-version-file: go.mod cache-dependency-path: go.sum - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Run GoReleaser id: releaser uses: goreleaser/goreleaser-action@v5 From 63b34cab852eb98306d1884beaf86f66a7c2cea6 Mon Sep 17 00:00:00 2001 From: Amit Zafran Date: Mon, 25 Mar 2024 11:49:03 +0200 Subject: [PATCH 31/37] fixed merge --- .github/workflows/ci.yml | 37 --------------------------- .github/workflows/lava.yml | 52 +++++--------------------------------- 2 files changed, 7 insertions(+), 82 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index f772debddc..0000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: CI - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - ci: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - cache-dependency-path: go.sum - - - name: Run GoReleaser - id: releaser - uses: goreleaser/goreleaser-action@v5 - with: - version: latest - args: build --snapshot - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: lava-binaries - path: dist/**/* diff --git a/.github/workflows/lava.yml b/.github/workflows/lava.yml index 278bc6f1d2..d10ce15026 100644 --- a/.github/workflows/lava.yml +++ b/.github/workflows/lava.yml @@ -10,20 +10,11 @@ on: jobs: ci: - strategy: - matrix: - binary: [lavad, lavap, lavavisor] - targetos: [darwin, linux] - arch: [amd64, arm64] runs-on: ubuntu-latest - env: - GOOS: ${{ matrix.targetos }} - GOARCH: ${{ matrix.arch }} - steps: - name: Checkout code uses: actions/checkout@v4 - + - name: Install Go uses: actions/setup-go@v5 with: @@ -35,41 +26,12 @@ jobs: uses: goreleaser/goreleaser-action@v5 with: version: latest - args: build --single-target --snapshot --clean - workdir: cmd/${{ matrix.binary }} + args: build --snapshot env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - uses: actions/upload-artifact@v4 + + - name: Upload Artifacts + uses: actions/upload-artifact@v4 with: - name: ${{ matrix.binary }}-${{ fromJson(steps.releaser.outputs.metadata).tag }}-${{ fromJson(steps.releaser.outputs.artifacts)[0].goos }}-${{ fromJson(steps.releaser.outputs.artifacts)[0].goarch }} - path: cmd/${{ matrix.binary }}/${{ fromJson(steps.releaser.outputs.artifacts)[0].path }} - - # - name: Docker meta - # id: meta - # uses: docker/metadata-action@v5 - # with: - # images: | - # lava/${{ matrix.binary }} - # ghcr.io/lavanet/${{ matrix.binary }} - # tags: | - # type=raw,value=latest,enable={{is_default_branch}} - # type=schedule - # type=ref,event=branch - # type=ref,event=pr - # type=semver,pattern={{version}} - # type=semver,pattern={{major}}.{{minor}} - # type=semver,pattern={{major}} - # type=sha - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v3 - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v3 - # - name: Build and push - # uses: docker/build-push-action@v5 - # with: - # context: . - # push: ${{ github.event_name != 'pull_request' }} - # tags: ${{ steps.meta.outputs.tags }} - # labels: ${{ steps.meta.outputs.labels }} - \ No newline at end of file + name: lava-binaries + path: dist/**/* \ No newline at end of file From 8929461ce986484f471bf669258ca900e34dff56 Mon Sep 17 00:00:00 2001 From: Amit Zafran Date: Mon, 25 Mar 2024 12:09:51 +0200 Subject: [PATCH 32/37] not using goreleaser for ci --- .github/workflows/lava.yml | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/lava.yml b/.github/workflows/lava.yml index d10ce15026..9ebdd1a58a 100644 --- a/.github/workflows/lava.yml +++ b/.github/workflows/lava.yml @@ -11,6 +11,15 @@ on: jobs: ci: runs-on: ubuntu-latest + strategy: + matrix: + arch: [amd64, arm64] + targetos: [darwin, linux] + binary: [lavad, lavap, lavavisor] + include: + - targetos: darwin + arch: arm64 + steps: - name: Checkout code uses: actions/checkout@v4 @@ -21,17 +30,15 @@ jobs: go-version-file: go.mod cache-dependency-path: go.sum - - name: Run GoReleaser - id: releaser - uses: goreleaser/goreleaser-action@v5 - with: - version: latest - args: build --snapshot - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Download Dependencies + run: go mod download + + - name: Build ${{ matrix.binary }} + run: | + GOWRK=off go build cmd/${{ matrix.binary }}/main.go - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: lava-binaries - path: dist/**/* \ No newline at end of file + # - name: Upload Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: ${{ matrix.binary }}-${{ matrix.targetos }}-${{ matrix.arch }} + # path: dist/**/* \ No newline at end of file From 0233b0bc7d810530b3aea131c7beff5110361590 Mon Sep 17 00:00:00 2001 From: Amit Zafran Date: Mon, 25 Mar 2024 12:10:26 +0200 Subject: [PATCH 33/37] using env --- .github/workflows/lava.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/lava.yml b/.github/workflows/lava.yml index 9ebdd1a58a..6d04bee5d5 100644 --- a/.github/workflows/lava.yml +++ b/.github/workflows/lava.yml @@ -29,6 +29,9 @@ jobs: with: go-version-file: go.mod cache-dependency-path: go.sum + env: + GOOS: ${{ matrix.targetos }} + GOARCH: ${{ matrix.arch }} - name: Download Dependencies run: go mod download From e1c3ce732d69c16ddeabf6d4430bb368595848d4 Mon Sep 17 00:00:00 2001 From: Amit Zafran Date: Mon, 25 Mar 2024 12:12:18 +0200 Subject: [PATCH 34/37] uploading pr artifacts --- .github/workflows/lava.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lava.yml b/.github/workflows/lava.yml index 6d04bee5d5..956cc21302 100644 --- a/.github/workflows/lava.yml +++ b/.github/workflows/lava.yml @@ -40,8 +40,8 @@ jobs: run: | GOWRK=off go build cmd/${{ matrix.binary }}/main.go - # - name: Upload Artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: ${{ matrix.binary }}-${{ matrix.targetos }}-${{ matrix.arch }} - # path: dist/**/* \ No newline at end of file + - name: Upload Lava Artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.binary }}-${{ matrix.targetos }}-${{ matrix.arch }} + path: cmd/${{ matrix.binary }}/${{ matrix.binary }} \ No newline at end of file From e4b3e3899cc47a4ed69586aba201b0aacc4af3f6 Mon Sep 17 00:00:00 2001 From: Amit Zafran Date: Mon, 25 Mar 2024 12:16:27 +0200 Subject: [PATCH 35/37] change binary path --- .github/workflows/lava.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lava.yml b/.github/workflows/lava.yml index 956cc21302..0e3ee0ed2b 100644 --- a/.github/workflows/lava.yml +++ b/.github/workflows/lava.yml @@ -8,8 +8,13 @@ on: branches: - main +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: ci: + name: ${{ matrix.binary }}-${{ matrix.targetos }}-${{ matrix.arch }} runs-on: ubuntu-latest strategy: matrix: @@ -38,10 +43,10 @@ jobs: - name: Build ${{ matrix.binary }} run: | - GOWRK=off go build cmd/${{ matrix.binary }}/main.go + GOWRK=off go build -o out cmd/${{ matrix.binary }}/main.go - name: Upload Lava Artifacts uses: actions/upload-artifact@v4 with: name: ${{ matrix.binary }}-${{ matrix.targetos }}-${{ matrix.arch }} - path: cmd/${{ matrix.binary }}/${{ matrix.binary }} \ No newline at end of file + path: out \ No newline at end of file From 209077065df5f95267a9cda54f4282f6d12e0c49 Mon Sep 17 00:00:00 2001 From: Amit Zafran Date: Mon, 25 Mar 2024 12:29:08 +0200 Subject: [PATCH 36/37] -o --- .github/workflows/lava.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lava.yml b/.github/workflows/lava.yml index 0e3ee0ed2b..6771fe5072 100644 --- a/.github/workflows/lava.yml +++ b/.github/workflows/lava.yml @@ -43,10 +43,10 @@ jobs: - name: Build ${{ matrix.binary }} run: | - GOWRK=off go build -o out cmd/${{ matrix.binary }}/main.go + GOWRK=off go build -o out/${{ matrix.binary }} cmd/${{ matrix.binary }}/main.go - name: Upload Lava Artifacts uses: actions/upload-artifact@v4 with: name: ${{ matrix.binary }}-${{ matrix.targetos }}-${{ matrix.arch }} - path: out \ No newline at end of file + path: out/${{ matrix.binary }} \ No newline at end of file From 7af2b5bc6b451947ae0be238acf0418fc3caac6f Mon Sep 17 00:00:00 2001 From: Amit Zafran Date: Mon, 25 Mar 2024 12:40:53 +0200 Subject: [PATCH 37/37] update release --- .github/workflows/release.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a60ffb1008..d2673888a8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,15 +11,7 @@ permissions: jobs: release: name: 'release' - strategy: - matrix: - binary: [lavad, lavap, lavavisor] - targetos: [darwin, linux] - arch: [amd64, arm64] runs-on: ubuntu-latest - env: - GOOS: ${{ matrix.targetos }} - GOARCH: ${{ matrix.arch }} permissions: contents: write @@ -46,7 +38,6 @@ jobs: with: version: latest args: release --clean --timeout 90m - workdir: cmd/${{ matrix.binary }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}