Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/build-on-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build on Commit

on:
push:
branches: [master, main]

jobs:
build-on-commit:
name: Build Latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Cache frontend dependencies
uses: actions/cache@v3
with:
path: frontend/node_modules
key: node-frontend-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
node-frontend-

- name: Cache backend dependencies
uses: actions/cache@v3
with:
path: backend/node_modules
key: node-backend-${{ hashFiles('backend/package-lock.json') }}
restore-keys: |
node-backend-

- name: Build frontend
working-directory: frontend
run: |
npm ci
npm run build

- name: Setup and verify backend
working-directory: backend
run: |
npm ci
node -c index.js

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: catatime-build-${{ github.sha }}
path: frontend/out
retention-days: 7
91 changes: 91 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: CI

on:
push:
branches: [master, main, develop]
pull_request:
branches: [master, main, develop]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install frontend dependencies
working-directory: frontend
run: npm ci

- name: Cache frontend dependencies
uses: actions/cache@v3
with:
path: frontend/
key: \
\
node-frontend-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
node-frontend-

- name: Lint frontend
working-directory: frontend
run: npm run lint

- name: Check backend syntax
working-directory: backend
run: |
npm ci
node -c index.js

build:
name: Build
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install frontend dependencies
working-directory: frontend
run: npm ci

- name: Cache frontend dependencies
uses: actions/cache@v3
with:
path: frontend/
key: \
\
node-frontend-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
node-frontend-

- name: Build frontend
working-directory: frontend
run: npm run build

- name: Install backend dependencies
working-directory: backend
run: npm ci

- name: Cache backend dependencies
uses: actions/cache@v3
with:
path: backend/node_modules
key: \
\
node-backend-${{ hashFiles('backend/package-lock.json') }}
restore-keys: |
node-backend-

- name: Verify backend
working-directory: backend
run: node -c index.js
74 changes: 74 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build Release

on:
push:
tags:
- 'v*'

jobs:
build-release:
name: Build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
build-command: npm run build:linux
artifact-path: frontend/out/artifacts
- os: macos-latest
build-command: npm run build:mac
artifact-path: frontend/out/artifacts
- os: windows-latest
build-command: npm run build:win
artifact-path: frontend/out/artifacts

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install frontend dependencies
working-directory: frontend
run: npm ci

- name: Cache frontend dependencies
uses: actions/cache@v3
with:
path: frontend/node_modules
key: node-frontend-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
node-frontend-

- name: Build ${{ matrix.os }}
working-directory: frontend
run: ${{ matrix.build-command }}

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: catatime-${{ matrix.os }}-${{ github.ref_name }}
path: ${{ matrix.artifact-path }}
if-no-files-found: ignore

create-release:
name: Create Release
runs-on: ubuntu-latest
needs: build-release
steps:
- uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: release-artifacts

- name: Create Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: release-artifacts/**/*
draft: false
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
Loading