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:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, reopened, edited]
|
||||
types: [opened, reopened, edited, auto_merge_enabled]
|
||||
|
||||
jobs:
|
||||
check:
|
||||
|
13
.github/workflows/update.yaml
vendored
13
.github/workflows/update.yaml
vendored
@ -5,6 +5,10 @@ on:
|
||||
- cron: "0 0 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
@ -35,5 +39,10 @@ jobs:
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
with:
|
||||
delete-branch: true
|
||||
title: Bump deps
|
||||
title: update
|
||||
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)
|
||||
minor=$(echo "${version}" | cut -d . -f2)
|
||||
patch=$(echo "${version}" | cut -d . -f3)
|
||||
case "${1}" in
|
||||
case "${1-patch}" in
|
||||
major) major=$((major + 1)) ;;
|
||||
minor) minor=$((minor + 1)) ;;
|
||||
*) patch=$((patch + 1)) ;;
|
||||
|
@ -11,6 +11,13 @@ if ! git diff --exit-code flake.lock; then
|
||||
git commit -m "build(nix): updated nix dependencies"
|
||||
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"
|
||||
cd "${git_root}/client"
|
||||
npm update --save && npm i
|
||||
|
4
client/package-lock.json
generated
4
client/package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "trevstack",
|
||||
"version": "0.0.25",
|
||||
"version": "0.0.29",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "trevstack",
|
||||
"version": "0.0.25",
|
||||
"version": "0.0.29",
|
||||
"devDependencies": {
|
||||
"@bufbuild/protovalidate": "^0.1.1",
|
||||
"@connectrpc/connect": "^2.0.2",
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "trevstack",
|
||||
"private": true,
|
||||
"version": "0.0.25",
|
||||
"version": "0.0.29",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
|
14
flake.nix
14
flake.nix
@ -21,7 +21,7 @@
|
||||
...
|
||||
}: let
|
||||
pname = "trevstack";
|
||||
version = "0.0.25";
|
||||
version = "0.0.29";
|
||||
|
||||
build-systems = [
|
||||
"x86_64-linux"
|
||||
@ -92,7 +92,7 @@
|
||||
revive
|
||||
sqlc
|
||||
|
||||
# database
|
||||
# Database
|
||||
sqlite
|
||||
dbmate
|
||||
sqlfluff
|
||||
@ -127,7 +127,7 @@
|
||||
pname = "check-client";
|
||||
inherit version;
|
||||
src = ./client;
|
||||
npmDepsHash = "sha256-IVTm9gQx2ceQoqyJfIz1PJeq3/yb/3NSgMNTIWSsDMQ=";
|
||||
npmDepsHash = "sha256-1Af4eOcvYIL6Y/gGn8PYaYAwPds/NOtSvyU13ByUH4A=";
|
||||
dontNpmInstall = true;
|
||||
|
||||
buildPhase = ''
|
||||
@ -160,9 +160,10 @@
|
||||
runtimeInputs = with pkgs; [
|
||||
git
|
||||
nix
|
||||
nodejs_22
|
||||
go
|
||||
nix-update
|
||||
go
|
||||
buf
|
||||
nodejs_22
|
||||
];
|
||||
text = builtins.readFile ./.scripts/update.sh;
|
||||
});
|
||||
@ -189,7 +190,7 @@
|
||||
client = pkgs.buildNpmPackage {
|
||||
inherit pname version;
|
||||
src = ./client;
|
||||
npmDepsHash = "sha256-IVTm9gQx2ceQoqyJfIz1PJeq3/yb/3NSgMNTIWSsDMQ=";
|
||||
npmDepsHash = "sha256-1Af4eOcvYIL6Y/gGn8PYaYAwPds/NOtSvyU13ByUH4A=";
|
||||
|
||||
installPhase = ''
|
||||
cp -r build "$out"
|
||||
@ -204,6 +205,7 @@
|
||||
|
||||
preBuild = ''
|
||||
cp -r ${client} client
|
||||
HOME=$PWD
|
||||
'';
|
||||
};
|
||||
in
|
||||
|
@ -3,7 +3,7 @@ servers:
|
||||
- url: /grpc
|
||||
info:
|
||||
title: Trevstack API
|
||||
version: 0.0.25
|
||||
version: 0.0.29
|
||||
description: API for Trevstack
|
||||
contact:
|
||||
name: Trev
|
||||
|
Reference in New Issue
Block a user