-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
167 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
name: PR Validation | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run-reviewdog: | ||
name: Run ReviewDog | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: ReviewDog - GolangCI Lint | ||
uses: reviewdog/action-golangci-lint@v2 | ||
with: | ||
go_version_file: go.mod | ||
tool_name: GolangCI Lint | ||
golangci_lint_flags: --config=.golangci.yaml --timeout=10m | ||
fail_on_error: true | ||
run-tests: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
- name: Tests | ||
run: make test-ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: release-please | ||
name: Release Please | ||
uses: google-github-actions/release-please-action@v4 | ||
with: | ||
release-type: go | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
if: steps.release-please.outputs.release_created | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
if: steps.release-please.outputs.release_created | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
if: steps.release-please.outputs.release_created | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
if: steps.release-please.outputs.release_created | ||
|
||
- name: Run GoReleaser | ||
if: steps.release-please.outputs.release_created | ||
run: make release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
project_name: validator-exporter | ||
before: | ||
hooks: | ||
- go mod tidy | ||
env: | ||
- CGO_ENABLED=0 | ||
builds: | ||
- main: "./cmd/{{ .ProjectName }}/main.go" | ||
binary: "{{ .ProjectName }}" | ||
goos: | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
flags: | ||
- -mod=readonly | ||
- -trimpath | ||
ldflags: | ||
- -s -w | ||
tags: | ||
- netgo | ||
|
||
universal_binaries: | ||
- replace: false | ||
|
||
dockers: | ||
- use: buildx | ||
goos: linux | ||
goarch: amd64 | ||
image_templates: | ||
- "ghcr.io/archway-network/{{ .ProjectName }}:{{ .Version }}-amd64" | ||
build_flag_templates: | ||
- "--pull" | ||
- "--platform=linux/amd64" | ||
- "--label=org.opencontainers.image.created={{.Date}}" | ||
- "--label=org.opencontainers.image.title={{.ProjectName}}" | ||
- "--label=org.opencontainers.image.revision={{.FullCommit}}" | ||
- "--label=org.opencontainers.image.version={{.Version}}" | ||
- use: buildx | ||
goos: linux | ||
goarch: arm64 | ||
image_templates: | ||
- "ghcr.io/archway-network/{{ .ProjectName }}:{{ .Version }}-arm64v8" | ||
build_flag_templates: | ||
- "--pull" | ||
- "--platform=linux/arm64" | ||
- "--label=org.opencontainers.image.created={{.Date}}" | ||
- "--label=org.opencontainers.image.title={{.ProjectName}}" | ||
- "--label=org.opencontainers.image.revision={{.FullCommit}}" | ||
- "--label=org.opencontainers.image.version={{.Version}}" | ||
docker_manifests: | ||
- name_template: ghcr.io/archway-network/{{ .ProjectName }}:{{ .Version }} | ||
image_templates: | ||
- ghcr.io/archway-network/{{ .ProjectName }}:{{ .Version }}-amd64 | ||
- ghcr.io/archway-network/{{ .ProjectName }}:{{ .Version }}-arm64v8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM gcr.io/distroless/static-debian12:nonroot | ||
|
||
COPY validator-exporter /usr/bin/validator-exporter | ||
|
||
# metrics server | ||
EXPOSE 8008 | ||
|
||
ENTRYPOINT [ "/usr/bin/validator-exporter" ] | ||
|
||
CMD [ "--help" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters