25 Commits

Author SHA1 Message Date
43fc67ded6 bump: v0.0.42 -> v0.0.43
Some checks failed
Check / check (push) Has been skipped
Release / check (push) Failing after 0s
Release / release (push) Has been skipped
Release / package (push) Has been skipped
2025-05-17 02:30:43 -04:00
8e7781a346 style: use better env
Some checks failed
Check / check (push) Failing after 0s
2025-05-17 02:29:04 -04:00
68dd90048f bump: v0.0.41 -> v0.0.42
Some checks failed
Check / check (push) Has been skipped
Release / check (push) Failing after 0s
Release / release (push) Has been skipped
Release / package (push) Has been skipped
2025-05-17 02:07:27 -04:00
7bf54bbd8c fix: use version
Some checks failed
Check / check (push) Failing after 0s
2025-05-17 02:05:54 -04:00
9fa5818860 bump: v0.0.40 -> v0.0.41
Some checks failed
Check / check (push) Has been skipped
Release / check (push) Failing after 0s
Release / release (push) Has been skipped
Release / package (push) Has been skipped
2025-05-17 01:56:26 -04:00
77859b3d94 fix: don't use repo for name
Some checks failed
Check / check (push) Failing after 0s
2025-05-17 01:54:56 -04:00
9e26479f67 bump: v0.0.39 -> v0.0.40
Some checks failed
Check / check (push) Has been skipped
Release / check (push) Failing after 0s
Release / release (push) Has been skipped
Release / package (push) Has been skipped
2025-05-17 01:50:01 -04:00
000797f930 fix: explicitly name registry
Some checks failed
Check / check (push) Failing after 0s
2025-05-17 01:48:32 -04:00
1e8e06738b bump: v0.0.38 -> v0.0.39
Some checks failed
Check / check (push) Has been skipped
Release / check (push) Failing after 0s
Release / release (push) Has been skipped
Release / package (push) Has been skipped
2025-05-17 01:45:32 -04:00
28dbf76789 fix: use repo name as name
Some checks failed
Check / check (push) Failing after 0s
2025-05-17 01:43:58 -04:00
93aa1ebd3b bump: v0.0.37 -> v0.0.38
Some checks failed
Check / check (push) Has been skipped
Release / check (push) Failing after 0s
Release / release (push) Has been skipped
Release / package (push) Has been skipped
2025-05-17 01:22:25 -04:00
bf13344cbe fix: needs check
Some checks failed
Check / check (push) Failing after 0s
2025-05-17 01:20:56 -04:00
62358e100c bump: v0.0.36 -> v0.0.37
Some checks failed
Check / check (push) Has been skipped
Release / check (push) Failing after 0s
Release / release (push) Has been skipped
Release / package (push) Has been skipped
2025-05-17 01:20:13 -04:00
7ee1cd94dc fix: use ref_name
Some checks failed
Check / check (push) Failing after 0s
2025-05-17 01:18:40 -04:00
893aa4db51 bump: v0.0.35 -> v0.0.36
Some checks failed
Check / check (push) Has been skipped
Release / check (push) Failing after 0s
Release / release (push) Has been skipped
Release / package (push) Has been skipped
2025-05-17 01:06:22 -04:00
6b9da9dc15 feat: build images with nix
Some checks failed
Check / check (push) Failing after 0s
2025-05-17 01:04:39 -04:00
44e08b62fd bump: v0.0.34 -> v0.0.35
Some checks failed
Check / check (push) Has been skipped
Release / check (push) Successful in 1m32s
Release / release (push) Successful in 3m47s
Release / package (push) Successful in 1m37s
Update / update (push) Failing after 59s
2025-05-16 18:47:11 -04:00
3feb35ea7b fix: formatting
All checks were successful
Check / check (push) Successful in 52s
2025-05-16 18:45:39 -04:00
849fec6f01 fix: bump real openapi.yaml too
All checks were successful
Check / check (push) Successful in 51s
2025-05-16 18:42:24 -04:00
d27ee1202b bump: v0.0.33 -> v0.0.34
All checks were successful
Check / check (push) Has been skipped
2025-05-16 18:38:32 -04:00
32ac21afd2 fix: move buf to proto dir so submodules get the same deps
All checks were successful
Check / check (push) Successful in 1m35s
2025-05-16 18:35:48 -04:00
39959f041d bump: v0.0.32 -> v0.0.33
Some checks failed
Check / check (push) Has been skipped
Release / check (push) Successful in 1m34s
Release / release (push) Successful in 3m34s
Release / package (push) Failing after 13s
2025-05-16 18:04:34 -04:00
124d702ec4 fix: there was no space
All checks were successful
Check / check (push) Successful in 51s
2025-05-16 18:03:02 -04:00
2587483733 bump: v0.0.31 -> v0.0.32
Some checks failed
Check / check (push) Has been skipped
Release / check (push) Successful in 1m32s
Release / release (push) Failing after 1m49s
Release / package (push) Has been skipped
2025-05-16 17:57:30 -04:00
575ec574dd fix: add dot to build
All checks were successful
Check / check (push) Successful in 52s
2025-05-16 17:55:48 -04:00
14 changed files with 141 additions and 103 deletions

View File

@ -47,12 +47,12 @@ jobs:
- name: Build
run: >
nix build
#trevstack-linux-amd64
#trevstack-linux-arm64
#trevstack-linux-arm
#trevstack-windows-amd64
#trevstack-darwin-amd64
#trevstack-darwin-arm64
.#trevstack-linux-amd64
.#trevstack-linux-arm64
.#trevstack-linux-arm
.#trevstack-windows-amd64
.#trevstack-darwin-amd64
.#trevstack-darwin-arm64
- name: Release
uses: akkuman/gitea-release-action@v1
@ -65,13 +65,20 @@ jobs:
runs-on: ubuntu-latest
needs: release # Wait for binary cache to propagate
steps:
- name: Get domain
id: get_domain
run: |
DOMAIN=$(basename ${{ gitea.server_url }})
echo $DOMAIN
echo "domain=$DOMAIN" >> $GITHUB_OUTPUT
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
${{ gitea.server_url }}/${{ gitea.repository }}
${{ steps.get_domain.outputs.domain }}/${{ gitea.repository }}
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=branch

View File

@ -30,9 +30,45 @@ jobs:
- name: Check
run: nix flake check
release:
# release:
# runs-on: ubuntu-latest
# needs: check
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Install Nix
# uses: cachix/install-nix-action@v31
# with:
# nix_path: nixpkgs=channel:nixos-unstable
# - name: Use Cachix
# uses: cachix/cachix-action@v16
# with:
# name: trevstack
# authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
# - name: Build
# run: >
# nix build
# .#trevstack-linux-amd64
# .#trevstack-linux-arm64
# .#trevstack-linux-arm
# .#trevstack-windows-amd64
# .#trevstack-darwin-amd64
# .#trevstack-darwin-arm64
# - name: Release
# uses: softprops/action-gh-release@v2
# with:
# generate_release_notes: true
# files: |-
# result*/bin/*
# https://docs.docker.com/build/ci/github-actions/manage-tags-labels/
package:
runs-on: ubuntu-latest
needs: check
needs: check # Wait for binary cache to propagate
steps:
- name: Checkout
uses: actions/checkout@v4
@ -48,39 +84,14 @@ jobs:
name: trevstack
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build
run: >
nix build
#trevstack-linux-amd64
#trevstack-linux-arm64
#trevstack-linux-arm
#trevstack-windows-amd64
#trevstack-darwin-amd64
#trevstack-darwin-arm64
- name: Set env
run: |
TAG=${{ github.ref_name }}
VERSION=${TAG#v}
REGISTRY="ghcr.io"
- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |-
result*/bin/*
# https://docs.docker.com/build/ci/github-actions/manage-tags-labels/
package:
runs-on: ubuntu-latest
needs: release # Wait for binary cache to propagate
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/${{ github.repository }}
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "REGISTRY=${REGISTRY}" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
@ -89,15 +100,39 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build & Load Images
run: |
nix build .#trevstack-linux-amd64-image && ./result | docker load
nix build .#trevstack-linux-arm64-image && ./result | docker load
nix build .#trevstack-linux-arm-image && ./result | docker load
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Push Images
run: |
docker image tag trevstack:$VERSION-amd64 $REGISTRY/$GITHUB_REPOSITORY:$VERSION-amd64
docker push $REGISTRY/$GITHUB_REPOSITORY:$VERSION-amd64
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
docker image tag trevstack:$VERSION-arm64 $REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm64
docker push $REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm64
docker image tag trevstack:$VERSION-arm $REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm
docker push $REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm
- name: Push Manifest
run: |
docker manifest create $REGISTRY/$GITHUB_REPOSITORY:$VERSION \
$REGISTRY/$GITHUB_REPOSITORY:$VERSION-amd64 \
$REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm64 \
$REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm
docker manifest annotate $REGISTRY/$GITHUB_REPOSITORY:$VERSION $REGISTRY/$GITHUB_REPOSITORY:$VERSION-amd64 --arch amd64
docker manifest annotate $REGISTRY/$GITHUB_REPOSITORY:$VERSION $REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm64 --arch arm64
docker manifest annotate $REGISTRY/$GITHUB_REPOSITORY:$VERSION $REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm --arch arm
docker manifest push $REGISTRY/$GITHUB_REPOSITORY:$VERSION
docker manifest create $REGISTRY/$GITHUB_REPOSITORY:latest \
$REGISTRY/$GITHUB_REPOSITORY:$VERSION-amd64 \
$REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm64 \
$REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm
docker manifest annotate $REGISTRY/$GITHUB_REPOSITORY:latest $REGISTRY/$GITHUB_REPOSITORY:$VERSION-amd64 --arch amd64
docker manifest annotate $REGISTRY/$GITHUB_REPOSITORY:latest $REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm64 --arch arm64
docker manifest annotate $REGISTRY/$GITHUB_REPOSITORY:latest $REGISTRY/$GITHUB_REPOSITORY:$VERSION-arm --arch arm
docker manifest push $REGISTRY/$GITHUB_REPOSITORY:latest

View File

@ -19,7 +19,9 @@ echo "${version} -> ${next_version}"
echo "bumping openapi"
cd "${git_root}"
sed -i -e "s/${version}/${next_version}/g" openapi.yaml
sed -i -e "s/${version}/${next_version}/g" client/static/openapi/openapi.yaml
git add openapi.yaml
git add client/static/openapi/openapi.yaml
echo "bumping client"
cd "${git_root}/client"

View File

@ -1,30 +0,0 @@
# Nix builder
FROM nixos/nix:latest AS builder
# Copy our source and setup our working dir.
COPY . /tmp/build
WORKDIR /tmp/build
# Build our Nix environment
RUN nix \
--extra-experimental-features "nix-command flakes" \
--option filter-syscalls false \
--accept-flake-config \
build
# Copy the Nix store closure into a directory. The Nix store closure is the
# entire set of Nix store values that we need for our build.
RUN mkdir /tmp/nix-store-closure
RUN cp -R $(nix-store -qR result/) /tmp/nix-store-closure
# Final image is based on scratch. We copy a bunch of Nix dependencies
# but they're fully self-contained so we don't need Nix anymore.
FROM scratch
WORKDIR /app
# Copy /nix/store
COPY --from=builder /tmp/nix-store-closure /nix/store
COPY --from=builder /tmp/build/result /app
CMD ["/app/bin/trevstack"]

View File

@ -42,7 +42,7 @@ It's that simple. If you're feeling fancy, install [direnv](https://direnv.net/)
- `nix flake check`: runs all validations
- `buf lint` & `buf generate`: lints and generates code from protocol buffers
- `buf lint proto` & `buf generate`: lints and generates code from protocol buffers
- `sqlc vet` & `sqlc generate`: verifies and generates code from SQL files
@ -55,7 +55,7 @@ To use github actions for CI/CD, you'll need to create a fine-grained personal a
- Contents (read and write)
- Pull requests (read and write)
and change some settings for the repository:
And change some settings for the repository:
- General -> Allow auto-merge: true
- Rules -> Rulesets -> New ruleset
@ -75,7 +75,7 @@ To use gitea actions for CI/CD, you'll need to create an [API token](https://doc
- write:repository
- write:package
and change some settings for the repository:
And change some settings for the repository:
- Repository -> Delete pull request branch after merge by default: true
- Branches -> Add New Rule

View File

@ -1,5 +1,8 @@
version: v2
clean: true
inputs:
- directory: proto
managed:
enabled: true
override:

View File

@ -1,12 +1,12 @@
{
"name": "trevstack",
"version": "0.0.31",
"version": "0.0.43",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "trevstack",
"version": "0.0.31",
"version": "0.0.43",
"devDependencies": {
"@bufbuild/protovalidate": "^0.1.1",
"@connectrpc/connect": "^2.0.2",

View File

@ -1,7 +1,7 @@
{
"name": "trevstack",
"private": true,
"version": "0.0.31",
"version": "0.0.43",
"type": "module",
"scripts": {
"dev": "vite dev",

View File

@ -3,8 +3,8 @@ servers:
- url: /grpc
info:
title: Trevstack API
version: 1.0.0
description: API for trevstack
version: 0.0.33
description: API for Trevstack
contact:
name: Trev
email: spam@trev.xyz

6
flake.lock generated
View File

@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1746904237,
"narHash": "sha256-3e+AVBczosP5dCLQmMoMEogM57gmZ2qrVSrmq9aResQ=",
"lastModified": 1747179050,
"narHash": "sha256-qhFMmDkeJX9KJwr5H32f1r7Prs7XbQWtO0h3V0a0rFY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d89fc19e405cb2d55ce7cc114356846a0ee5e956",
"rev": "adaa24fbf46737f3f1b5497bf64bae750f82942e",
"type": "github"
},
"original": {

View File

@ -21,7 +21,7 @@
...
}: let
pname = "trevstack";
version = "0.0.31";
version = "0.0.43";
build-systems = [
"x86_64-linux"
@ -83,7 +83,10 @@
packages = with pkgs; [
treli.packages."${system}".default
git
# Nix
nix-update
alejandra
# Server
go
@ -127,7 +130,7 @@
pname = "check-client";
inherit version;
src = ./client;
npmDepsHash = "sha256-9FUZNG+LEGWop0zpmTPx9d6TUOzjAMtLnxiH6HY6Vz4=";
npmDepsHash = "sha256-vgOTish91m4iVNCMuLfFRpTGdyyVr+/g4Ex3PRWqqGI=";
dontNpmInstall = true;
buildPhase = ''
@ -190,7 +193,7 @@
client = pkgs.buildNpmPackage {
inherit pname version;
src = ./client;
npmDepsHash = "sha256-9FUZNG+LEGWop0zpmTPx9d6TUOzjAMtLnxiH6HY6Vz4=";
npmDepsHash = "sha256-vgOTish91m4iVNCMuLfFRpTGdyyVr+/g4Ex3PRWqqGI=";
installPhase = ''
cp -r build "$out"
@ -208,11 +211,8 @@
HOME=$PWD
'';
};
in
{
default = server;
}
// builtins.listToAttrs (builtins.map (x: {
binaries = builtins.listToAttrs (builtins.map (x: {
name = "${pname}-${x.GOOS}-${x.GOARCH}";
value = server.overrideAttrs {
nativeBuildInputs =
@ -235,7 +235,28 @@
'';
};
})
host-systems)
host-systems);
images = builtins.listToAttrs (builtins.map (x: {
name = "${pname}-${x.GOOS}-${x.GOARCH}-image";
value = pkgs.dockerTools.streamLayeredImage {
name = "${pname}";
tag = "${version}-${x.GOARCH}";
created = "now";
architecture = "${x.GOARCH}";
contents = [binaries."${pname}-${x.GOOS}-${x.GOARCH}"];
config = {
Cmd = ["${binaries."${pname}-${x.GOOS}-${x.GOARCH}"}/bin/${pname}-${x.GOOS}-${x.GOARCH}-${version}"];
};
};
})
(builtins.filter (x: x.GOOS == "linux") host-systems));
in
{
default = server;
}
// binaries
// images
);
};
}

View File

@ -3,7 +3,7 @@ servers:
- url: /grpc
info:
title: Trevstack API
version: 0.0.31
version: 0.0.43
description: API for Trevstack
contact:
name: Trev

View File

@ -1,6 +1,6 @@
# For details on buf.yaml configuration, visit https://buf.build/docs/configuration/v2/buf-yaml
version: v2
modules:
- path: proto
- path: .
deps:
- buf.build/bufbuild/protovalidate