Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
2b07f74cc1 | |||
ee4d2984dd | |||
dd80776bb1 | |||
d0e7ae9284 | |||
63433be0bb | |||
1a856e575e | |||
a3e4154fb6 | |||
4839b74bf7 | |||
dcf5a16c3f | |||
932d82c1fc | |||
db509ffa8a | |||
c4392601b1 |
33
.gitea/workflows/check.yaml
Normal file
33
.gitea/workflows/check.yaml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
name: Check
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
types: [opened, reopened, edited, auto_merge_enabled]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
name: check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: |
|
||||||
|
contains(github.event.head_commit.message, 'bump:') == false &&
|
||||||
|
contains(github.event.head_commit.message, 'Merge pull request') == false
|
||||||
|
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: Check
|
||||||
|
run: nix flake check
|
98
.gitea/workflows/release.yaml
Normal file
98
.gitea/workflows/release.yaml
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
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: Check
|
||||||
|
run: nix flake check
|
||||||
|
|
||||||
|
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: akkuman/gitea-release-action@v1
|
||||||
|
with:
|
||||||
|
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: |
|
||||||
|
${{ github.repository }}
|
||||||
|
# generate Docker tags based on the following events/attributes
|
||||||
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
|
||||||
|
- name: Login to Gitea Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ vars.URL }}
|
||||||
|
username: ${{ vars.USERNAME }}
|
||||||
|
password: ${{ secrets.PASSWORD }}
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
39
.gitea/workflows/update.yaml
Normal file
39
.gitea/workflows/update.yaml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
name: Update
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * *"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
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 }}"
|
||||||
|
|
||||||
|
# https://github.com/actions/checkout/issues/13
|
||||||
|
- name: Set Git Config
|
||||||
|
run: |
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
|
- name: Update
|
||||||
|
run: nix run .#update
|
||||||
|
|
||||||
|
- name: Create Pull Request
|
||||||
|
uses: peter-evans/create-pull-request@v7
|
||||||
|
with:
|
||||||
|
title: update
|
||||||
|
body: automatic update
|
2
.github/workflows/check.yaml
vendored
2
.github/workflows/check.yaml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, reopened, edited]
|
types: [opened, reopened, edited, auto_merge_enabled]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
|
13
.github/workflows/update.yaml
vendored
13
.github/workflows/update.yaml
vendored
@ -5,6 +5,10 @@ on:
|
|||||||
- cron: "0 0 * * *"
|
- cron: "0 0 * * *"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update:
|
update:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -35,5 +39,10 @@ jobs:
|
|||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v7
|
||||||
with:
|
with:
|
||||||
delete-branch: true
|
title: update
|
||||||
title: Bump deps
|
body: automatic update
|
||||||
|
|
||||||
|
- name: Enable Automerge
|
||||||
|
run: gh pr merge --merge --auto "1"
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.PAT }}
|
||||||
|
@ -7,7 +7,7 @@ version=${git_version#v}
|
|||||||
major=$(echo "${version}" | cut -d . -f1)
|
major=$(echo "${version}" | cut -d . -f1)
|
||||||
minor=$(echo "${version}" | cut -d . -f2)
|
minor=$(echo "${version}" | cut -d . -f2)
|
||||||
patch=$(echo "${version}" | cut -d . -f3)
|
patch=$(echo "${version}" | cut -d . -f3)
|
||||||
case "${1}" in
|
case "${1-patch}" in
|
||||||
major) major=$((major + 1)) ;;
|
major) major=$((major + 1)) ;;
|
||||||
minor) minor=$((minor + 1)) ;;
|
minor) minor=$((minor + 1)) ;;
|
||||||
*) patch=$((patch + 1)) ;;
|
*) patch=$((patch + 1)) ;;
|
||||||
|
@ -11,6 +11,13 @@ if ! git diff --exit-code flake.lock; then
|
|||||||
git commit -m "build(nix): updated nix dependencies"
|
git commit -m "build(nix): updated nix dependencies"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "updating protobuf deps"
|
||||||
|
buf dep update
|
||||||
|
if ! git diff --exit-code buf.lock; then
|
||||||
|
git add buf.lock
|
||||||
|
git commit -m "build(buf): updated buf dependencies"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "updating client"
|
echo "updating client"
|
||||||
cd "${git_root}/client"
|
cd "${git_root}/client"
|
||||||
npm update --save && npm i
|
npm update --save && npm i
|
||||||
|
4
client/package-lock.json
generated
4
client/package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "trevstack",
|
"name": "trevstack",
|
||||||
"version": "0.0.25",
|
"version": "0.0.29",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "trevstack",
|
"name": "trevstack",
|
||||||
"version": "0.0.25",
|
"version": "0.0.29",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@bufbuild/protovalidate": "^0.1.1",
|
"@bufbuild/protovalidate": "^0.1.1",
|
||||||
"@connectrpc/connect": "^2.0.2",
|
"@connectrpc/connect": "^2.0.2",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "trevstack",
|
"name": "trevstack",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.25",
|
"version": "0.0.29",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
|
14
flake.nix
14
flake.nix
@ -21,7 +21,7 @@
|
|||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
pname = "trevstack";
|
pname = "trevstack";
|
||||||
version = "0.0.25";
|
version = "0.0.29";
|
||||||
|
|
||||||
build-systems = [
|
build-systems = [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
@ -92,7 +92,7 @@
|
|||||||
revive
|
revive
|
||||||
sqlc
|
sqlc
|
||||||
|
|
||||||
# database
|
# Database
|
||||||
sqlite
|
sqlite
|
||||||
dbmate
|
dbmate
|
||||||
sqlfluff
|
sqlfluff
|
||||||
@ -127,7 +127,7 @@
|
|||||||
pname = "check-client";
|
pname = "check-client";
|
||||||
inherit version;
|
inherit version;
|
||||||
src = ./client;
|
src = ./client;
|
||||||
npmDepsHash = "sha256-IVTm9gQx2ceQoqyJfIz1PJeq3/yb/3NSgMNTIWSsDMQ=";
|
npmDepsHash = "sha256-1Af4eOcvYIL6Y/gGn8PYaYAwPds/NOtSvyU13ByUH4A=";
|
||||||
dontNpmInstall = true;
|
dontNpmInstall = true;
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
@ -160,9 +160,10 @@
|
|||||||
runtimeInputs = with pkgs; [
|
runtimeInputs = with pkgs; [
|
||||||
git
|
git
|
||||||
nix
|
nix
|
||||||
nodejs_22
|
|
||||||
go
|
|
||||||
nix-update
|
nix-update
|
||||||
|
go
|
||||||
|
buf
|
||||||
|
nodejs_22
|
||||||
];
|
];
|
||||||
text = builtins.readFile ./.scripts/update.sh;
|
text = builtins.readFile ./.scripts/update.sh;
|
||||||
});
|
});
|
||||||
@ -189,7 +190,7 @@
|
|||||||
client = pkgs.buildNpmPackage {
|
client = pkgs.buildNpmPackage {
|
||||||
inherit pname version;
|
inherit pname version;
|
||||||
src = ./client;
|
src = ./client;
|
||||||
npmDepsHash = "sha256-IVTm9gQx2ceQoqyJfIz1PJeq3/yb/3NSgMNTIWSsDMQ=";
|
npmDepsHash = "sha256-1Af4eOcvYIL6Y/gGn8PYaYAwPds/NOtSvyU13ByUH4A=";
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
cp -r build "$out"
|
cp -r build "$out"
|
||||||
@ -204,6 +205,7 @@
|
|||||||
|
|
||||||
preBuild = ''
|
preBuild = ''
|
||||||
cp -r ${client} client
|
cp -r ${client} client
|
||||||
|
HOME=$PWD
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
@ -3,7 +3,7 @@ servers:
|
|||||||
- url: /grpc
|
- url: /grpc
|
||||||
info:
|
info:
|
||||||
title: Trevstack API
|
title: Trevstack API
|
||||||
version: 0.0.25
|
version: 0.0.29
|
||||||
description: API for Trevstack
|
description: API for Trevstack
|
||||||
contact:
|
contact:
|
||||||
name: Trev
|
name: Trev
|
||||||
|
Reference in New Issue
Block a user