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

fix: Do 2153 pr artifacts #1331

Merged
merged 40 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 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
fba63fa
Merge branch 'main' into DO-2153-pr-artifacts
Mar 25, 2024
bcfef15
Merge remote-tracking branch 'origin/main' into DO-2153-pr-artifacts
Mar 25, 2024
2671f1a
single goreleaser file
Mar 25, 2024
53544c2
cmd
Mar 25, 2024
e040e57
upload pattern
Mar 25, 2024
1860857
cache
Mar 25, 2024
94d6322
checkout first
Mar 25, 2024
63b34ca
fixed merge
Mar 25, 2024
8929461
not using goreleaser for ci
Mar 25, 2024
0233b0b
using env
Mar 25, 2024
e1c3ce7
uploading pr artifacts
Mar 25, 2024
e4b3e38
change binary path
Mar 25, 2024
2090770
-o
Mar 25, 2024
7af2b5b
update release
Mar 25, 2024
d27bc7f
Merge remote-tracking branch 'origin/main' into DO-2153-pr-artifacts
Mar 25, 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
73 changes: 25 additions & 48 deletions .github/workflows/lava.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

- 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 }}
9 changes: 0 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -46,7 +38,6 @@ jobs:
with:
version: latest
args: release --clean --timeout 90m
workdir: cmd/${{ matrix.binary }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
60 changes: 58 additions & 2 deletions cmd/lavavisor/.goreleaser.yaml → .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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:
Expand Down Expand Up @@ -91,4 +147,4 @@ release:
replace_existing_draft: true
name_template: "Lava v{{.Version}} 🌋"
mode: replace
draft: true
draft: true
94 changes: 0 additions & 94 deletions cmd/lavad/.goreleaser.yaml

This file was deleted.

94 changes: 0 additions & 94 deletions cmd/lavap/.goreleaser.yaml

This file was deleted.

Loading