Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .commitlintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
extends:
- '@commitlint/config-conventional'
4 changes: 0 additions & 4 deletions .github/workflows/lint-commit.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: Lint Commit Messages
on:
push:
branches:
- main
- develop
pull_request:

permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/quality-gates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
extends: relaxed
rules:
line-length:
max: 80
max: 100
level: warning
indentation: disable

Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write
packages: write
env:
CONTAINER_REGISTRY: ghcr.io

jobs:
release:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
# history is needed for the goreleaser to generate changelogs and couple of other things
fetch-depth: 0

- uses: actions/setup-go@v5
with:
go-version: '1.24.4'

- name: Extract spec version
run: |
MARGO_SPEC_VERSION=$(grep -A 0 ' version:' ./standard/snapshot.spec.yaml | tail -1 | awk '{print $2}')
echo "MARGO_SPEC_VERSION=${MARGO_SPEC_VERSION}" >> $GITHUB_ENV

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.CONTAINER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ github.TOKEN }}

# Builds binaries and generates the release changelog.
# For details on the release artifacts, see: docs/release.md
- name: Run GoReleaser
Comment thread
singhmj-1 marked this conversation as resolved.
uses: goreleaser/goreleaser-action@v7
with:
version: v2
args: release --clean
env:
GITHUB_TOKEN: ${{ github.token }}
MARGO_SPEC_VERSION: ${{ env.MARGO_SPEC_VERSION }}
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,12 @@ linters:
generated: lax
warn-unused: false
presets: []

rules:
# Tests can have unused variables and short error handling
- path: "_test\\.go$"
linters:
- unused
- errcheck

# Mock files excluded from unused checks
- path: "mock_.*\\.go$"
linters:
Expand Down
75 changes: 75 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
version: 2

project_name: margo-sandbox

before:
hooks:
- go mod tidy
- go mod download

builds:
- id: "linux-amd64"
main: ./poc/device/agent
# Binary name.
# Can be a path (e.g. `bin/app`).
binary: device-agent
flags:
- -trimpath
ldflags:
- -X main.build={{.Version}} -X main.commit={{.Commit}} -X main.date={{.CommitDate}}
goos:
- linux
goarch:
- amd64
- arm64

dockers_v2:
- images:
- "ghcr.io/margo/workload-fleet-management-client"
dockerfile: ./poc/device/agent/Dockerfile
platforms:
- linux/amd64
- linux/arm64
build_args:
VERSION: "{{.Version}}"
DATE: "{{.CommitDate}}"
COMMIT: "{{.Commit}}"
labels:
org.opencontainers.image.title: "{{.ProjectName}}"
org.opencontainers.image.description: "Margo sandbox workload fleet management client. A reference implementation."
org.opencontainers.image.source: "{{.GitURL}}"
org.opencontainers.image.version: "{{.Version}}"
org.opencontainers.image.revision: "{{.FullCommit}}"
org.opencontainers.image.created: "{{.CommitDate}}"

report_sizes: true

archives:
- formats:
- tar.gz
name_template: '{{.ProjectName}}_{{.Version}}_{{.Os}}-{{.Arch}}'
files:
- README.md
- LICENSE

checksum:
name_template: "{{.ProjectName}}_checksums.txt"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- 'README'
- Merge pull request
- Merge branch

release:
footer: |
## This release targets the Margo specification version: {{env.MARGO_SPEC_VERSION}}, and can be tracked here, https://github.com/margo/specification .
github:
owner: margo
name: sandbox
disable: false
Loading
Loading