2025-02-21 13:42:23 +01:00
|
|
|
name: Release Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
branches:
|
|
|
|
- ci-test
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test-and-build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Setup SSH
|
|
|
|
run: |
|
|
|
|
mkdir ~/.ssh
|
|
|
|
chmod 700 ~/.ssh
|
|
|
|
echo "${{ secrets.ALTAIR_SSH_KEY }}" > ~/.ssh/id_ed25519
|
|
|
|
chmod 600 ~/.ssh/id_ed25519
|
|
|
|
ssh-keyscan -p 999 tehga.me >> ~/.ssh/known_hosts
|
|
|
|
ssh-keyscan -p 999 doradus.tehga.me >> ~/.ssh/known_hosts
|
|
|
|
|
|
|
|
- name: Checkout
|
|
|
|
run: git clone --depth 1 ssh://gitea@tehga.me:999/wasp/quicknotes.git --branch main --single-branch /workdir
|
|
|
|
|
|
|
|
- name: Setup Go
|
|
|
|
uses: actions/setup-go@v5
|
|
|
|
with:
|
|
|
|
go-version: '1.24'
|
|
|
|
cache: true
|
|
|
|
|
|
|
|
- name: Setup Bun
|
|
|
|
uses: oven-sh/setup-bun@v1
|
|
|
|
with:
|
|
|
|
bun-version: latest
|
|
|
|
|
|
|
|
- name: Install Playwright Browsers
|
|
|
|
working-directory: /workdir/frontend
|
2025-02-21 16:06:35 +01:00
|
|
|
run: bun test:install
|
2025-02-21 13:42:23 +01:00
|
|
|
|
|
|
|
- name: Install golangci-lint
|
|
|
|
run: |
|
|
|
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2
|
|
|
|
golangci-lint --version
|
|
|
|
|
|
|
|
- name: Run Pre-commit Checks
|
|
|
|
working-directory: /workdir
|
|
|
|
run: |
|
|
|
|
chmod +x scripts/pre-commit.sh
|
|
|
|
./scripts/pre-commit.sh
|
|
|
|
|
|
|
|
- name: Optimize Frontend Build
|
|
|
|
working-directory: /workdir/frontend
|
|
|
|
run: |
|
|
|
|
bun install
|
|
|
|
NODE_ENV=production bun run build
|
|
|
|
|
|
|
|
- name: Build Backend (Release Mode)
|
|
|
|
working-directory: /workdir
|
|
|
|
run: |
|
|
|
|
go build -ldflags="-s -w" -o notes-app
|
|
|
|
|
|
|
|
- name: Package Release
|
|
|
|
working-directory: /workdir
|
|
|
|
run: |
|
|
|
|
mkdir -p release
|
|
|
|
cp notes-app release/
|
|
|
|
cp -r frontend/build release/frontend/
|
|
|
|
cp -r static release/
|
|
|
|
tar czf quicknotes.tar.gz release/
|
|
|
|
|
|
|
|
- name: Create Release
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
files: /workdir/quicknotes.tar.gz
|
|
|
|
draft: false
|
|
|
|
prerelease: false
|
|
|
|
|
|
|
|
- name: Upload Build Artifact
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: quicknotes
|
|
|
|
path: /workdir/quicknotes.tar.gz
|