Experiment with automatic packaging and releasing
use rust-webapp image for release use npm rather than pnpm use node 24 use rust latest image add cache to release check for tag before releasing check for tag before releasing release 0.0.3
This commit is contained in:
68
.gitea/workflows/release.yaml
Normal file
68
.gitea/workflows/release.yaml
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
name: Backend Actions
|
||||||
|
run-name: ${{ gitea.actor }} is running backend actions
|
||||||
|
on: [push]
|
||||||
|
# push:
|
||||||
|
# tags:
|
||||||
|
# - 'v[0-9]+\.[0-9]+\.[0-9]+'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
package:
|
||||||
|
runs-on: rust-latest
|
||||||
|
depends-on: ["check-tag"]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Check for Tag
|
||||||
|
run: ./check-for-tag.sh
|
||||||
|
|
||||||
|
- name: Create Output Directory
|
||||||
|
if: ${{ steps.check_tag.outputs.release_tag != '' }}
|
||||||
|
run: mkdir package
|
||||||
|
- name: Setup Node
|
||||||
|
if: ${{ steps.check_tag.outputs.release_tag != '' }}
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '24'
|
||||||
|
- name: Load Cache
|
||||||
|
if: ${{ steps.check_tag.outputs.release_tag != '' }}
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
backend/target
|
||||||
|
ui/node_modules
|
||||||
|
key: ${{ runner.os }}-package-${{ hashFiles('backend/Cargo.lock') }}-${{ hashFiles('ui/package-lock.json') }}
|
||||||
|
|
||||||
|
- name: Install UI Dependencies
|
||||||
|
if: ${{ steps.check_tag.outputs.release_tag != '' }}
|
||||||
|
working-directory: ui
|
||||||
|
run: npm ci
|
||||||
|
- name: Build UI
|
||||||
|
if: ${{ steps.check_tag.outputs.release_tag != '' }}
|
||||||
|
working-directory: ui
|
||||||
|
run: npm run build
|
||||||
|
- name: Copy Output
|
||||||
|
if: ${{ steps.check_tag.outputs.release_tag != '' }}
|
||||||
|
run: cp -rv ui/.output package/ui
|
||||||
|
|
||||||
|
|
||||||
|
- name: Build Backend
|
||||||
|
if: ${{ steps.check_tag.outputs.release_tag != '' }}
|
||||||
|
working-directory: backend
|
||||||
|
run: cargo build --release --locked
|
||||||
|
- name: Copy Binary
|
||||||
|
if: ${{ steps.check_tag.outputs.release_tag != '' }}
|
||||||
|
run: cp -v backend/target/release/nuchat package/
|
||||||
|
|
||||||
|
- name: Package Output
|
||||||
|
if: ${{ steps.check_tag.outputs.release_tag != '' }}
|
||||||
|
run: tar -cf - package | zstd -19 -T0 -o package.tar.zst
|
||||||
|
|
||||||
|
- name: Upload Package
|
||||||
|
if: ${{ steps.check_tag.outputs.release_tag != '' }}
|
||||||
|
run: |-
|
||||||
|
curl -X PUT \
|
||||||
|
-H 'Authorization: token ${{ secrets.PACKAGE_API_KEY }}' \
|
||||||
|
--upload-file package.tar.zst \
|
||||||
|
"https://git.molloy.xyz/api/packages/fergus-molloy/generic/nuchat/${{ $RELEASE_TAG }}/nuchat.tar.zst"
|
||||||
|
|
||||||
11
check-for-tag.sh
Executable file
11
check-for-tag.sh
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
TAGS="$(git tag --points-at HEAD)"
|
||||||
|
echo "Found tags $TAGS"
|
||||||
|
if [ -n "$TAGS" ]; then
|
||||||
|
TAG=$(echo "$TAGS" | grep -E '^v[0-9]+.[0-9]+.[0-9]+$' | sort -V | tail -1)
|
||||||
|
echo "Found release tag $TAG"
|
||||||
|
echo "release_tag=$TAG" >> "$GITHUB_OUTPUTS"
|
||||||
|
else
|
||||||
|
echo "No release tag found"
|
||||||
|
fi
|
||||||
@ -2,11 +2,5 @@
|
|||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
compatibilityDate: '2025-07-15',
|
compatibilityDate: '2025-07-15',
|
||||||
devtools: { enabled: true },
|
devtools: { enabled: true },
|
||||||
|
modules: ['@nuxt/eslint', '@nuxt/icon', '@nuxt/test-utils']
|
||||||
modules: [
|
|
||||||
'@nuxt/eslint',
|
|
||||||
'@nuxt/icon',
|
|
||||||
'@nuxt/image',
|
|
||||||
'@nuxt/test-utils'
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
14387
ui/package-lock.json
generated
Normal file
14387
ui/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -11,11 +11,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/eslint": "1.6.0",
|
"@nuxt/eslint": "1.6.0",
|
||||||
"@nuxt/icon": "1.15.0",
|
"@nuxt/icon": "^1.15.0",
|
||||||
"@nuxt/image": "1.10.0",
|
"@nuxt/test-utils": "^3.19.2",
|
||||||
"@nuxt/test-utils": "3.19.2",
|
"nuxt": "^4.0.1",
|
||||||
"eslint": "^9.31.0",
|
|
||||||
"nuxt": "^4.0.0",
|
|
||||||
"vue": "^3.5.17",
|
"vue": "^3.5.17",
|
||||||
"vue-router": "^4.5.1"
|
"vue-router": "^4.5.1"
|
||||||
}
|
}
|
||||||
|
|||||||
9958
ui/pnpm-lock.yaml
generated
9958
ui/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user