diff --git a/.github/workflows/lava.yml b/.github/workflows/lava.yml index 278bc6f1d2..6771fe5072 100644 --- a/.github/workflows/lava.yml +++ b/.github/workflows/lava.yml @@ -8,68 +8,45 @@ 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: - binary: [lavad, lavap, lavavisor] - targetos: [darwin, linux] arch: [amd64, arm64] - runs-on: ubuntu-latest - env: - GOOS: ${{ matrix.targetos }} - GOARCH: ${{ matrix.arch }} + targetos: [darwin, linux] + binary: [lavad, lavap, lavavisor] + include: + - targetos: darwin + arch: arm64 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 --single-target --snapshot --clean - workdir: cmd/${{ matrix.binary }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GOOS: ${{ matrix.targetos }} + GOARCH: ${{ matrix.arch }} - - 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: Download Dependencies + run: go mod download - # - 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: Build ${{ matrix.binary }} + run: | + 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/${{ matrix.binary }} \ No newline at end of file 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 }} diff --git a/cmd/lavavisor/.goreleaser.yaml b/.goreleaser.yaml similarity index 70% rename from cmd/lavavisor/.goreleaser.yaml rename to .goreleaser.yaml index 45e3d6aeb9..ec42c2f749 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: cmd/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: cmd/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: cmd/lavap env: - CGO_ENABLED=0 goos: @@ -91,4 +147,4 @@ release: replace_existing_draft: true name_template: "Lava v{{.Version}} 🌋" mode: replace - draft: true \ No newline at end of file + draft: true diff --git a/cmd/lavad/.goreleaser.yaml b/cmd/lavad/.goreleaser.yaml deleted file mode 100644 index 4db235b7cc..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 \ No newline at end of file diff --git a/cmd/lavap/.goreleaser.yaml b/cmd/lavap/.goreleaser.yaml deleted file mode 100644 index 147c1aeeee..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 \ No newline at end of file