Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: DO-2153 Create Artifacts for PR #1306

Merged
merged 43 commits into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d1ca7f1
only run for PRs to main
Mar 16, 2024
c352645
using goreleaser
Mar 16, 2024
8bafa5c
updated main to use go releaser
Mar 17, 2024
c6f4d16
remove working dir
Mar 17, 2024
ce1e4ee
fetch-depth: 0
Mar 17, 2024
4455d4f
adding goreleaser config files
Mar 17, 2024
34d3cc0
added docker
Mar 17, 2024
4412a7e
added config to lavap and visor
Mar 17, 2024
98cf147
added nfpms
Mar 17, 2024
e73568d
added id and binary
Mar 17, 2024
9615e76
update pipeline
Mar 17, 2024
f1471b6
--skip=validate
Mar 17, 2024
11a7262
no need for both snapshot and skip
Mar 17, 2024
c7849ab
use: buildx
Mar 17, 2024
eaa9f79
update config
Mar 17, 2024
6427be2
rename workflow files
Mar 17, 2024
1bff9b3
update job name
Mar 17, 2024
7eccc0a
matrix strategy
Mar 17, 2024
75707fc
running on macos as well
Mar 18, 2024
fbea052
artifact names
Mar 18, 2024
0495e69
fronJson
Mar 18, 2024
400d54c
naming
Mar 18, 2024
5f27d01
windows-latest
Mar 18, 2024
f358c7f
update goreleasr files
Mar 18, 2024
3f11618
update releaser files
Mar 18, 2024
4237e51
remove packages
Mar 21, 2024
05c91dc
test releaser path
Mar 21, 2024
04db8b9
relative
Mar 21, 2024
14c7fb6
cmd/lavad
Mar 21, 2024
537a304
remove checkout 0 and upload
Mar 21, 2024
0ab860d
remove redundant test
Mar 21, 2024
3386538
remove test
Mar 21, 2024
ea33101
using goreleasre
Mar 21, 2024
1214c3d
added bot integ
Mar 21, 2024
132a9a7
put checkout first
Mar 21, 2024
3a4a009
pipeline name change
Mar 21, 2024
acf60f4
dockerilfe
Mar 23, 2024
700e96e
comment docker creation
Mar 24, 2024
a5cde1f
remove wip dockerfile
Mar 24, 2024
d42f301
upload pr binaries
Mar 24, 2024
fddb87e
naming
Mar 24, 2024
3788137
artifactgs
Mar 24, 2024
0824d89
0
Mar 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
ci:
strategy:
matrix:
binary: [lavad, lavap, lavavisor]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.20.5

- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- 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 }}

- 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/*
10 changes: 6 additions & 4 deletions .github/workflows/main.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,22 @@ on:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
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
args: --print-issued-lines --config .golangci.yml -v
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,5 @@ testutil/e2e/sdk/tests/node_modules.json
config/health_examples/health_template_gen.yml
# Yarn
.yarn/

**/dist/
76 changes: 76 additions & 0 deletions cmd/lavad/.goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# 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:
- id: lavad
binary: lavad
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
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"

nfpms:
- id: lavad
maintainer: Amit <[email protected]>


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

sboms:
- artifacts: archive

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
75 changes: 75 additions & 0 deletions cmd/lavap/.goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# 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:
- id: lavap
binary: lavap
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
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"

nfpms:
- id: lavap
maintainer: Amit <[email protected]>

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

sboms:
- artifacts: archive

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
74 changes: 74 additions & 0 deletions cmd/lavavisor/.goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# 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:
- id: lavavisor
binary: lavavisor
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
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

nfpms:
- id: lavavisor
maintainer: Amit <[email protected]>

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

sboms:
- artifacts: archive

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
Loading