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
44 changes: 0 additions & 44 deletions .github/workflows/build.yml

This file was deleted.

153 changes: 153 additions & 0 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
name: core
run-name: Triggered by ${{ github.event_name }} to ${{ github.ref }} by @${{ github.actor }}

on:
push:
branches:
- "**"
tags:
- "**"

jobs:
build:
runs-on: ${{ matrix.runner }}
name: Build ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
runner: ubuntu-24.04
- platform: linux/arm64
runner: ubuntu-24.04-arm

permissions:
contents: read
packages: write

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

- 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: Generate platform pair
id: platform
run: |
platform=${{ matrix.platform }}
echo "pair=${platform//\//-}" >> $GITHUB_OUTPUT

- name: Build and push by digest
id: build
uses: docker/build-push-action@v5
with:
context: core
platforms: ${{ matrix.platform }}
outputs: type=image,name=ghcr.io/gaucho-racing/sentinel-core,push-by-digest=true,name-canonical=true,push=true
cache-from: type=gha,scope=build-${{ steps.platform.outputs.pair }}
cache-to: type=gha,scope=build-${{ steps.platform.outputs.pair }},mode=max

- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"

- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ steps.platform.outputs.pair }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

merge:
runs-on: ubuntu-latest
name: Merge manifests
needs: build

permissions:
contents: read
packages: write

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

- name: Download digests
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true

- 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: Check if this commit has a release tag
id: release
run: |
tag=$(git tag --points-at HEAD | grep '^v' | head -n1)
if [ -n "$tag" ]; then
echo "Found tag: $tag"
if gh release view "$tag" --json tagName > /dev/null 2>&1; then
echo "release_tag=$tag" >> $GITHUB_OUTPUT
echo "is_release=true" >> $GITHUB_OUTPUT
exit 0
fi
fi
echo "is_release=false" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Generate tag list
id: tags
shell: bash
run: |
TAGS="type=sha"

if [ "${GITHUB_REF_TYPE}" = "branch" ] && [ "${GITHUB_REF_NAME}" = "main" ]; then
TAGS="${TAGS}\ntype=raw,value=latest"
fi

if [ "${{ steps.release.outputs.is_release }}" = "true" ]; then
CLEAN_TAG=$(echo "${{ steps.release.outputs.release_tag }}" | sed 's/^v//')
TAGS="${TAGS}\ntype=raw,value=${CLEAN_TAG}"
fi

echo -e "tags<<EOF\n$TAGS\nEOF" >> $GITHUB_OUTPUT

- name: Extract image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/gaucho-racing/sentinel-core
tags: ${{ steps.tags.outputs.tags }}

- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf 'ghcr.io/gaucho-racing/sentinel-core@sha256:%s ' *)

- name: Inspect image
run: |
docker buildx imagetools inspect ghcr.io/gaucho-racing/sentinel-core:${{ steps.meta.outputs.version }}
31 changes: 0 additions & 31 deletions .github/workflows/tests.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ drive-service-account.json
# Go workspace file
go.work

# Air hot reload
tmp/

coverage.html

jwtRS256.key
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Gaucho Racing
Copyright (c) 2026 Gaucho Racing

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ clean:
rm *.out
rm coverage.html

run:
chmod +x scripts/run.sh
./scripts/run.sh
run-core:
chmod +x scripts/run-core.sh
./scripts/run-core.sh

keygen:
chmod +x scripts/keygen.sh
Expand Down
48 changes: 0 additions & 48 deletions commands/alumni.go

This file was deleted.

78 changes: 0 additions & 78 deletions commands/drive.go

This file was deleted.

Loading