Skip to content
Open
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
19 changes: 19 additions & 0 deletions .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "2.17.0",
"resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:25b9f05705ffba7dbe503230ac76081419306f8c8bc88e0ce78c4ecd99a0c78c",
"integrity": "sha256:25b9f05705ffba7dbe503230ac76081419306f8c8bc88e0ce78c4ecd99a0c78c"
},
"ghcr.io/devcontainers/features/go:1": {
"version": "1.3.4",
"resolved": "ghcr.io/devcontainers/features/go@sha256:d85e921f91b41340055bb12b325d9d551170ed04b3b832e33530bf42f167c032",
"integrity": "sha256:d85e921f91b41340055bb12b325d9d551170ed04b3b832e33530bf42f167c032"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "1.7.1",
"resolved": "ghcr.io/devcontainers/features/node@sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6",
"integrity": "sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6"
}
}
}
33 changes: 33 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "Corteca CLI",
"image": "mcr.microsoft.com/devcontainers/go:1.24",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
"moby": false
},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/go:1": {
"version": "none",
"golangciLintVersion": "latest"
}
},
"postCreateCommand": "sudo apt-get update && sudo apt-get install -y msitools ",
"customizations": {
"vscode": {
"extensions": [
"streetsidesoftware.code-spell-checker",
"golang.Go",
"davidanson.vscode-markdownlint",
"github.vscode-github-actions",
"ms-azuretools.vscode-containers",
"ms-vscode.makefile-tools"
]
}
},
"remoteEnv": {
"PODMAN_USERS": "keep-id",
"IN_DEVCONTAINER": "1"
},
"containerUser": "vscode"
}
58 changes: 56 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,68 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0 # required for git describe --tags used in VERSION

- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: Build
run: make

test:
name: Tests
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0 # required for git describe --tags used in VERSION

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: Run tests
run: make test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage.out
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}

lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: Go lint
uses: golangci/golangci-lint-action@v7
with:
version: latest

- name: YAML lint
run: |
pip install --quiet yamllint
yamllint -c .yamllint.yaml .

- name: Markdown lint
uses: DavidAnson/markdownlint-cli2-action@v18
with:
config: .markdownlint.yaml
globs: '**/*.md'
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
name: Build and publish
runs-on: ubuntu-latest
permissions:
contents: write # create GitHub Release and upload assets
packages: write # push to GHCR

steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0 # required for git describe --tags

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: Install nfpm
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.40.0

- name: Get version
id: version
run: echo "version=$(git describe --tags)" >> "$GITHUB_OUTPUT"

- name: Build packages
run: |
make deb DESTARCH=amd64
make deb DESTARCH=arm64
make rpm DESTARCH=amd64
make rpm DESTARCH=arm64
make osx DESTARCH=amd64
make osx DESTARCH=arm64

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/packages/*

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push container image
uses: docker/build-push-action@v6
with:
context: .
file: corteca-cli.Dockerfile
platforms: linux/amd64,linux/arm64
push: true
build-args: |
VERSION=${{ steps.version.outputs.version }}
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ steps.version.outputs.version }}
31 changes: 0 additions & 31 deletions .github/workflows/test.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
/dist
nfpm.yaml
coverage.out

.DS_Store
.claude
12 changes: 12 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "2"

run:
timeout: 5m

linters:
enable:
- errcheck
- govet
- ineffassign
- staticcheck
- unused
3 changes: 3 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
default: true
MD013: false # line length — not enforced
MD033: false # inline HTML — used in README (logo div)
7 changes: 7 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends: default

rules:
line-length:
max: 120
truthy:
allowed-values: ['true', 'false']
Loading
Loading