Compare commits
No commits in common. "main" and "v0.0.31" have entirely different histories.
@ -1,21 +0,0 @@
|
|||||||
name: "Initialize"
|
|
||||||
description: "Install nix & use cachix"
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
token:
|
|
||||||
description: "cachix auth token"
|
|
||||||
required: true
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- 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: "${{ inputs.token }}"
|
|
@ -1,63 +0,0 @@
|
|||||||
name: "Docker Push"
|
|
||||||
description: "Push to docker registry"
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
server_url:
|
|
||||||
required: true
|
|
||||||
repository:
|
|
||||||
required: true
|
|
||||||
tag:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Set env
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
REGISTRY=$(basename ${{ inputs.server_url }})
|
|
||||||
|
|
||||||
NR=${{ inputs.repository }}
|
|
||||||
NAMESPACE="${NR%%/*}"
|
|
||||||
REPOSITORY="${NR##*/}"
|
|
||||||
|
|
||||||
TAG=${{ inputs.tag }}
|
|
||||||
VERSION=${TAG#v}
|
|
||||||
|
|
||||||
echo "REGISTRY=${REGISTRY}" >> $GITHUB_ENV
|
|
||||||
echo "NAMESPACE=${NAMESPACE}" >> $GITHUB_ENV
|
|
||||||
echo "REPOSITORY=${REPOSITORY}" >> $GITHUB_ENV
|
|
||||||
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Push images
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
docker image tag $REPOSITORY:$VERSION-amd64 $REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-amd64
|
|
||||||
docker push $REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-amd64
|
|
||||||
|
|
||||||
docker image tag $REPOSITORY:$VERSION-arm64 $REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-arm64
|
|
||||||
docker push $REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-arm64
|
|
||||||
|
|
||||||
docker image tag $REPOSITORY:$VERSION-arm $REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-arm
|
|
||||||
docker push $REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-arm
|
|
||||||
|
|
||||||
- name: Push manifest
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
docker manifest create $REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION \
|
|
||||||
$REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-amd64 \
|
|
||||||
$REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-arm64 \
|
|
||||||
$REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-arm
|
|
||||||
docker manifest annotate $REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION $REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-amd64 --arch amd64
|
|
||||||
docker manifest annotate $REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION $REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-arm64 --arch arm64
|
|
||||||
docker manifest annotate $REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION $REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-arm --arch arm
|
|
||||||
docker manifest push $REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION
|
|
||||||
|
|
||||||
docker manifest create $REGISTRY/$NAMESPACE/$REPOSITORY:latest \
|
|
||||||
$REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-amd64 \
|
|
||||||
$REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-arm64 \
|
|
||||||
$REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-arm
|
|
||||||
docker manifest annotate $REGISTRY/$NAMESPACE/$REPOSITORY:latest $REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-amd64 --arch amd64
|
|
||||||
docker manifest annotate $REGISTRY/$NAMESPACE/$REPOSITORY:latest $REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-arm64 --arch arm64
|
|
||||||
docker manifest annotate $REGISTRY/$NAMESPACE/$REPOSITORY:latest $REGISTRY/$NAMESPACE/$REPOSITORY:$VERSION-arm --arch arm
|
|
||||||
docker manifest push $REGISTRY/$NAMESPACE/$REPOSITORY:latest
|
|
14
.dockerignore
Normal file
14
.dockerignore
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
.env
|
||||||
|
/docker-compose.*
|
||||||
|
/result*
|
||||||
|
/.direnv/
|
||||||
|
/build/
|
||||||
|
|
||||||
|
# Client
|
||||||
|
/client/node_modules/
|
||||||
|
/client/.svelte-kit/
|
||||||
|
|
||||||
|
# Server
|
||||||
|
/server/client/
|
||||||
|
/server/tmp/
|
||||||
|
/server/build/
|
@ -12,12 +12,22 @@ jobs:
|
|||||||
name: check
|
name: check
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: |
|
if: |
|
||||||
contains(github.event.head_commit.message, 'bump:') == false &&
|
contains(gitea.event.head_commit.message, 'bump:') == false &&
|
||||||
contains(github.event.head_commit.message, 'Merge pull request') == false
|
contains(gitea.event.head_commit.message, 'Merge pull request') == false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
- uses: ./.actions/init
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
|
||||||
|
|
||||||
- run: nix flake check
|
- 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
|
||||||
|
@ -9,60 +9,90 @@ jobs:
|
|||||||
check:
|
check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
- uses: ./.actions/init
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
|
||||||
|
|
||||||
- run: nix flake check
|
- 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:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: check
|
needs: check
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
- uses: ./.actions/init
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@v31
|
||||||
with:
|
with:
|
||||||
token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
|
||||||
- run: >
|
- name: Use Cachix
|
||||||
|
uses: cachix/cachix-action@v16
|
||||||
|
with:
|
||||||
|
name: trevstack
|
||||||
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: >
|
||||||
nix build
|
nix build
|
||||||
.#trevstack-linux-amd64
|
#trevstack-linux-amd64
|
||||||
.#trevstack-linux-arm64
|
#trevstack-linux-arm64
|
||||||
.#trevstack-linux-arm
|
#trevstack-linux-arm
|
||||||
.#trevstack-windows-amd64
|
#trevstack-windows-amd64
|
||||||
.#trevstack-darwin-amd64
|
#trevstack-darwin-amd64
|
||||||
.#trevstack-darwin-arm64
|
#trevstack-darwin-arm64
|
||||||
|
|
||||||
- uses: akkuman/gitea-release-action@v1
|
- name: Release
|
||||||
|
uses: akkuman/gitea-release-action@v1
|
||||||
with:
|
with:
|
||||||
files: |-
|
files: |-
|
||||||
result*/bin/*
|
result*/bin/*
|
||||||
|
|
||||||
|
# https://docs.docker.com/build/ci/github-actions/manage-tags-labels/
|
||||||
package:
|
package:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: release
|
needs: release # Wait for binary cache to propagate
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Docker meta
|
||||||
- uses: ./.actions/init
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
# list of Docker images to use as base name for tags
|
||||||
|
images: |
|
||||||
|
${{ gitea.server_url }}/${{ gitea.repository }}
|
||||||
|
# generate Docker tags based on the following events/attributes
|
||||||
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
|
||||||
- uses: docker/login-action@v3
|
- name: Login to Gitea Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ github.server_url }}
|
registry: ${{ gitea.server_url }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ gitea.actor }}
|
||||||
password: ${{ secrets.PAT }}
|
password: ${{ secrets.PAT }}
|
||||||
|
|
||||||
- name: Build & load images
|
- name: Set up QEMU
|
||||||
run: |
|
uses: docker/setup-qemu-action@v3
|
||||||
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: Push images
|
- name: Set up Docker Buildx
|
||||||
uses: ./.actions/push
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
server_url: ${{ github.server_url }}
|
push: true
|
||||||
repository: ${{ github.repository }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
tag: ${{ github.ref_name }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
@ -9,21 +9,33 @@ jobs:
|
|||||||
update:
|
update:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
- uses: ./.actions/init
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- 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
|
# https://github.com/actions/checkout/issues/13
|
||||||
- name: Set git config
|
- name: Set Git Config
|
||||||
run: |
|
run: |
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
git checkout -B update
|
git checkout -B update
|
||||||
|
|
||||||
- run: nix run .#update
|
- name: Update
|
||||||
|
run: nix run .#update
|
||||||
|
|
||||||
- name: Create pull request
|
- name: Create Pull Request
|
||||||
env:
|
env:
|
||||||
PAT: ${{ secrets.PAT }}
|
PAT: ${{ secrets.PAT }}
|
||||||
run: |
|
run: |
|
||||||
@ -36,14 +48,14 @@ jobs:
|
|||||||
PR_RESPONSE=$(curl -s -X POST -H "Authorization: token $PAT" \
|
PR_RESPONSE=$(curl -s -X POST -H "Authorization: token $PAT" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"title":"update","body":"automatic update","head":"update","base":"main"}' \
|
-d '{"title":"update","body":"automatic update","head":"update","base":"main"}' \
|
||||||
"$URL/api/v1/repos/$REPO_OWNER_SLASH_NAME/pulls")
|
"https://$URL/api/v1/repos/$REPO_OWNER_SLASH_NAME/pulls")
|
||||||
|
|
||||||
PR_NUMBER=$(echo "$PR_RESPONSE" | jq -r '.number')
|
PR_NUMBER=$(echo "$PR_RESPONSE" | jq -r '.number')
|
||||||
|
|
||||||
curl -s -X POST -H "Authorization: token $PAT" \
|
curl -s -X POST -H "Authorization: token $PAT" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"Do":"merge","merge_when_checks_succeed":true,"delete_branch_after_merge":true}' \
|
-d '{"Do":"merge","merge_when_checks_succeed":true,"delete_branch_after_merge":true}' \
|
||||||
"$URL/api/v1/repos/$REPO_OWNER_SLASH_NAME/pulls/$PR_NUMBER/merge"
|
"https://$URL/api/v1/repos/$REPO_OWNER_SLASH_NAME/pulls/$PR_NUMBER/merge"
|
||||||
|
|
||||||
else
|
else
|
||||||
git push origin update --force
|
git push origin update --force
|
||||||
|
20
.github/workflows/check.yaml
vendored
20
.github/workflows/check.yaml
vendored
@ -15,9 +15,19 @@ jobs:
|
|||||||
contains(github.event.head_commit.message, 'bump:') == false &&
|
contains(github.event.head_commit.message, 'bump:') == false &&
|
||||||
contains(github.event.head_commit.message, 'Merge pull request') == false
|
contains(github.event.head_commit.message, 'Merge pull request') == false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
- uses: ./.actions/init
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
|
||||||
|
|
||||||
- run: nix flake check
|
- 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
|
||||||
|
92
.github/workflows/release.yaml
vendored
92
.github/workflows/release.yaml
vendored
@ -13,61 +13,91 @@ jobs:
|
|||||||
check:
|
check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
- uses: ./.actions/init
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
|
||||||
|
|
||||||
- run: nix flake check
|
- 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:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: check
|
needs: check
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
- uses: ./.actions/init
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@v31
|
||||||
with:
|
with:
|
||||||
token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
|
||||||
- run: >
|
- name: Use Cachix
|
||||||
|
uses: cachix/cachix-action@v16
|
||||||
|
with:
|
||||||
|
name: trevstack
|
||||||
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: >
|
||||||
nix build
|
nix build
|
||||||
.#trevstack-linux-amd64
|
#trevstack-linux-amd64
|
||||||
.#trevstack-linux-arm64
|
#trevstack-linux-arm64
|
||||||
.#trevstack-linux-arm
|
#trevstack-linux-arm
|
||||||
.#trevstack-windows-amd64
|
#trevstack-windows-amd64
|
||||||
.#trevstack-darwin-amd64
|
#trevstack-darwin-amd64
|
||||||
.#trevstack-darwin-arm64
|
#trevstack-darwin-arm64
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v2
|
- name: Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
files: |-
|
files: |-
|
||||||
result*/bin/*
|
result*/bin/*
|
||||||
|
|
||||||
|
# https://docs.docker.com/build/ci/github-actions/manage-tags-labels/
|
||||||
package:
|
package:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: release
|
needs: release # Wait for binary cache to propagate
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Docker meta
|
||||||
- uses: ./.actions/init
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
# 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}}
|
||||||
|
|
||||||
- uses: docker/login-action@v3
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build & load images
|
- name: Set up QEMU
|
||||||
run: |
|
uses: docker/setup-qemu-action@v3
|
||||||
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: Push images
|
- name: Set up Docker Buildx
|
||||||
uses: ./.actions/push
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
server_url: ghcr.io
|
push: true
|
||||||
repository: ${{ github.repository }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
tag: ${{ github.ref_name }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
24
.github/workflows/update.yaml
vendored
24
.github/workflows/update.yaml
vendored
@ -13,20 +13,30 @@ jobs:
|
|||||||
update:
|
update:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
- uses: ./.actions/init
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@v31
|
||||||
with:
|
with:
|
||||||
token: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
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
|
# https://github.com/actions/checkout/issues/13
|
||||||
- name: Set git config
|
- name: Set Git Config
|
||||||
run: |
|
run: |
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
- run: nix run .#update
|
- name: Update
|
||||||
|
run: nix run .#update
|
||||||
|
|
||||||
- name: Create pull request
|
- name: Create Pull Request
|
||||||
id: cpr
|
id: cpr
|
||||||
uses: peter-evans/create-pull-request@v7
|
uses: peter-evans/create-pull-request@v7
|
||||||
with:
|
with:
|
||||||
@ -34,7 +44,7 @@ jobs:
|
|||||||
title: update
|
title: update
|
||||||
body: automatic update
|
body: automatic update
|
||||||
|
|
||||||
- name: Enable automerge
|
- name: Enable Automerge
|
||||||
run: gh pr merge --merge --auto "${{ steps.cpr.outputs.pull-request-number }}"
|
run: gh pr merge --merge --auto "${{ steps.cpr.outputs.pull-request-number }}"
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.PAT }}
|
GH_TOKEN: ${{ secrets.PAT }}
|
||||||
|
@ -19,9 +19,7 @@ echo "${version} -> ${next_version}"
|
|||||||
echo "bumping openapi"
|
echo "bumping openapi"
|
||||||
cd "${git_root}"
|
cd "${git_root}"
|
||||||
sed -i -e "s/${version}/${next_version}/g" openapi.yaml
|
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 openapi.yaml
|
||||||
git add client/static/openapi/openapi.yaml
|
|
||||||
|
|
||||||
echo "bumping client"
|
echo "bumping client"
|
||||||
cd "${git_root}/client"
|
cd "${git_root}/client"
|
||||||
|
@ -12,7 +12,6 @@ if ! git diff --exit-code flake.lock; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "updating protobuf deps"
|
echo "updating protobuf deps"
|
||||||
cd "${git_root}/proto"
|
|
||||||
buf dep update
|
buf dep update
|
||||||
if ! git diff --exit-code buf.lock; then
|
if ! git diff --exit-code buf.lock; then
|
||||||
git add buf.lock
|
git add buf.lock
|
||||||
|
30
Dockerfile
Normal file
30
Dockerfile
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# 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"]
|
@ -42,7 +42,7 @@ It's that simple. If you're feeling fancy, install [direnv](https://direnv.net/)
|
|||||||
|
|
||||||
- `nix flake check`: runs all validations
|
- `nix flake check`: runs all validations
|
||||||
|
|
||||||
- `buf lint proto` & `buf generate`: lints and generates code from protocol buffers
|
- `buf lint` & `buf generate`: lints and generates code from protocol buffers
|
||||||
|
|
||||||
- `sqlc vet` & `sqlc generate`: verifies and generates code from SQL files
|
- `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)
|
- Contents (read and write)
|
||||||
- Pull requests (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
|
- General -> Allow auto-merge: true
|
||||||
- Rules -> Rulesets -> New ruleset
|
- 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:repository
|
||||||
- write:package
|
- 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
|
- Repository -> Delete pull request branch after merge by default: true
|
||||||
- Branches -> Add New Rule
|
- Branches -> Add New Rule
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
version: v2
|
version: v2
|
||||||
clean: true
|
clean: true
|
||||||
inputs:
|
|
||||||
- directory: proto
|
|
||||||
|
|
||||||
managed:
|
managed:
|
||||||
enabled: true
|
enabled: true
|
||||||
override:
|
override:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# For details on buf.yaml configuration, visit https://buf.build/docs/configuration/v2/buf-yaml
|
# For details on buf.yaml configuration, visit https://buf.build/docs/configuration/v2/buf-yaml
|
||||||
version: v2
|
version: v2
|
||||||
modules:
|
modules:
|
||||||
- path: .
|
- path: proto
|
||||||
deps:
|
deps:
|
||||||
- buf.build/bufbuild/protovalidate
|
- buf.build/bufbuild/protovalidate
|
1744
client/package-lock.json
generated
1744
client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "trevstack",
|
"name": "trevstack",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.47",
|
"version": "0.0.31",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
@ -21,29 +21,29 @@
|
|||||||
"@eslint/js": "^9.18.0",
|
"@eslint/js": "^9.18.0",
|
||||||
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
||||||
"@lucide/svelte": "^0.479.0",
|
"@lucide/svelte": "^0.479.0",
|
||||||
"@scalar/api-reference": "^1.28.34",
|
"@scalar/api-reference": "^1.28.33",
|
||||||
"@simplewebauthn/browser": "^13.1.0",
|
"@simplewebauthn/browser": "^13.1.0",
|
||||||
"@sveltejs/adapter-static": "^3.0.8",
|
"@sveltejs/adapter-static": "^3.0.8",
|
||||||
"@sveltejs/kit": "^2.21.1",
|
"@sveltejs/kit": "^2.21.0",
|
||||||
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
||||||
"@tailwindcss/vite": "^4.1.7",
|
"@tailwindcss/vite": "^4.1.6",
|
||||||
"bits-ui": "^1.5.3",
|
"bits-ui": "^1.4.8",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"eslint": "^9.27.0",
|
"eslint": "^9.26.0",
|
||||||
"eslint-config-prettier": "^10.1.5",
|
"eslint-config-prettier": "^10.1.5",
|
||||||
"eslint-plugin-svelte": "^3.8.1",
|
"eslint-plugin-svelte": "^3.6.0",
|
||||||
"globals": "^16.1.0",
|
"globals": "^16.1.0",
|
||||||
"mode-watcher": "^1.0.7",
|
"mode-watcher": "^1.0.7",
|
||||||
"prettier": "^3.5.3",
|
"prettier": "^3.5.3",
|
||||||
"prettier-plugin-svelte": "^3.4.0",
|
"prettier-plugin-svelte": "^3.3.3",
|
||||||
"prettier-plugin-tailwindcss": "^0.6.11",
|
"prettier-plugin-tailwindcss": "^0.6.11",
|
||||||
"svelte": "^5.31.1",
|
"svelte": "^5.28.6",
|
||||||
"svelte-check": "^4.2.1",
|
"svelte-check": "^4.1.7",
|
||||||
"svelte-sonner": "^0.3.28",
|
"svelte-sonner": "^0.3.28",
|
||||||
"tailwind-merge": "^3.3.0",
|
"tailwind-merge": "^3.3.0",
|
||||||
"tailwind-variants": "^1.0.0",
|
"tailwind-variants": "^1.0.0",
|
||||||
"tailwindcss": "^4.0.13",
|
"tailwindcss": "^4.0.13",
|
||||||
"tw-animate-css": "^1.3.0",
|
"tw-animate-css": "^1.2.9",
|
||||||
"typescript": "^5.8.3",
|
"typescript": "^5.8.3",
|
||||||
"typescript-eslint": "^8.32.1",
|
"typescript-eslint": "^8.32.1",
|
||||||
"vite": "^6.3.5"
|
"vite": "^6.3.5"
|
||||||
|
@ -3,8 +3,8 @@ servers:
|
|||||||
- url: /grpc
|
- url: /grpc
|
||||||
info:
|
info:
|
||||||
title: Trevstack API
|
title: Trevstack API
|
||||||
version: 0.0.33
|
version: 1.0.0
|
||||||
description: API for Trevstack
|
description: API for trevstack
|
||||||
contact:
|
contact:
|
||||||
name: Trev
|
name: Trev
|
||||||
email: spam@trev.xyz
|
email: spam@trev.xyz
|
||||||
|
6
flake.lock
generated
6
flake.lock
generated
@ -2,11 +2,11 @@
|
|||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1747542820,
|
"lastModified": 1746904237,
|
||||||
"narHash": "sha256-GaOZntlJ6gPPbbkTLjbd8BMWaDYafhuuYRNrxCGnPJw=",
|
"narHash": "sha256-3e+AVBczosP5dCLQmMoMEogM57gmZ2qrVSrmq9aResQ=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "292fa7d4f6519c074f0a50394dbbe69859bb6043",
|
"rev": "d89fc19e405cb2d55ce7cc114356846a0ee5e956",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
39
flake.nix
39
flake.nix
@ -21,7 +21,7 @@
|
|||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
pname = "trevstack";
|
pname = "trevstack";
|
||||||
version = "0.0.47";
|
version = "0.0.31";
|
||||||
|
|
||||||
build-systems = [
|
build-systems = [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
@ -83,10 +83,7 @@
|
|||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
treli.packages."${system}".default
|
treli.packages."${system}".default
|
||||||
git
|
git
|
||||||
|
|
||||||
# Nix
|
|
||||||
nix-update
|
nix-update
|
||||||
alejandra
|
|
||||||
|
|
||||||
# Server
|
# Server
|
||||||
go
|
go
|
||||||
@ -130,7 +127,7 @@
|
|||||||
pname = "check-client";
|
pname = "check-client";
|
||||||
inherit version;
|
inherit version;
|
||||||
src = ./client;
|
src = ./client;
|
||||||
npmDepsHash = "sha256-dl32ehKir0dZ4uiJ4s59xPIIbMkkZtH9dlTm4W0PZag=";
|
npmDepsHash = "sha256-9FUZNG+LEGWop0zpmTPx9d6TUOzjAMtLnxiH6HY6Vz4=";
|
||||||
dontNpmInstall = true;
|
dontNpmInstall = true;
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
@ -193,7 +190,7 @@
|
|||||||
client = pkgs.buildNpmPackage {
|
client = pkgs.buildNpmPackage {
|
||||||
inherit pname version;
|
inherit pname version;
|
||||||
src = ./client;
|
src = ./client;
|
||||||
npmDepsHash = "sha256-dl32ehKir0dZ4uiJ4s59xPIIbMkkZtH9dlTm4W0PZag=";
|
npmDepsHash = "sha256-9FUZNG+LEGWop0zpmTPx9d6TUOzjAMtLnxiH6HY6Vz4=";
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
cp -r build "$out"
|
cp -r build "$out"
|
||||||
@ -211,8 +208,11 @@
|
|||||||
HOME=$PWD
|
HOME=$PWD
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
in
|
||||||
binaries = builtins.listToAttrs (builtins.map (x: {
|
{
|
||||||
|
default = server;
|
||||||
|
}
|
||||||
|
// builtins.listToAttrs (builtins.map (x: {
|
||||||
name = "${pname}-${x.GOOS}-${x.GOARCH}";
|
name = "${pname}-${x.GOOS}-${x.GOARCH}";
|
||||||
value = server.overrideAttrs {
|
value = server.overrideAttrs {
|
||||||
nativeBuildInputs =
|
nativeBuildInputs =
|
||||||
@ -235,28 +235,7 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
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
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ servers:
|
|||||||
- url: /grpc
|
- url: /grpc
|
||||||
info:
|
info:
|
||||||
title: Trevstack API
|
title: Trevstack API
|
||||||
version: 0.0.47
|
version: 0.0.31
|
||||||
description: API for Trevstack
|
description: API for Trevstack
|
||||||
contact:
|
contact:
|
||||||
name: Trev
|
name: Trev
|
||||||
|
Loading…
x
Reference in New Issue
Block a user