Archipelago — open-source initial import
This commit is contained in:
@@ -0,0 +1,219 @@
|
||||
name: macOS Production Build
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version number (e.g., 0.1.0)'
|
||||
required: true
|
||||
default: '0.1.0'
|
||||
|
||||
env:
|
||||
RUST_VERSION: stable
|
||||
NODE_VERSION: 18
|
||||
|
||||
jobs:
|
||||
build-macos:
|
||||
name: Build macOS App
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set version
|
||||
id: version
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
||||
VERSION="${{ github.event.inputs.version }}"
|
||||
else
|
||||
VERSION="${GITHUB_REF#refs/tags/v}"
|
||||
fi
|
||||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "Building version: $VERSION"
|
||||
|
||||
- name: Setup Rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ env.RUST_VERSION }}
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: 'npm'
|
||||
cache-dependency-path: neode-ui/package-lock.json
|
||||
|
||||
- name: Install frontend dependencies
|
||||
working-directory: neode-ui
|
||||
run: npm ci
|
||||
|
||||
- name: Build Rust backend (Release)
|
||||
working-directory: core
|
||||
run: |
|
||||
cargo build --release --workspace
|
||||
strip target/release/archipelago
|
||||
ls -lh target/release/archipelago
|
||||
|
||||
- name: Build Vue.js frontend (Production)
|
||||
working-directory: neode-ui
|
||||
run: |
|
||||
npm run build:production
|
||||
ls -lh dist/
|
||||
|
||||
- name: Run production build script
|
||||
env:
|
||||
ARCHIPELAGO_VERSION: ${{ steps.version.outputs.VERSION }}
|
||||
run: |
|
||||
chmod +x build-macos-production.sh
|
||||
./build-macos-production.sh
|
||||
|
||||
- name: Verify build artifacts
|
||||
run: |
|
||||
ls -lh build/macos/
|
||||
if [ ! -d "build/macos/Archipelago.app" ]; then
|
||||
echo "❌ App bundle not found!"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f "build/macos/Archipelago-${{ steps.version.outputs.VERSION }}-macOS.dmg" ]; then
|
||||
echo "⚠️ DMG not created (optional)"
|
||||
fi
|
||||
|
||||
- name: Code sign (if credentials available)
|
||||
if: ${{ secrets.MACOS_CERTIFICATE != '' }}
|
||||
env:
|
||||
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
||||
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
|
||||
KEYCHAIN_PWD: ${{ secrets.KEYCHAIN_PWD }}
|
||||
run: |
|
||||
# Import certificate
|
||||
echo "$MACOS_CERTIFICATE" | base64 --decode > certificate.p12
|
||||
security create-keychain -p "$KEYCHAIN_PWD" build.keychain
|
||||
security default-keychain -s build.keychain
|
||||
security unlock-keychain -p "$KEYCHAIN_PWD" build.keychain
|
||||
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
|
||||
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PWD" build.keychain
|
||||
|
||||
# Sign the app
|
||||
codesign --deep --force --verify --verbose \
|
||||
--sign "Developer ID Application" \
|
||||
--options runtime \
|
||||
build/macos/Archipelago.app
|
||||
|
||||
# Verify
|
||||
codesign --verify --verbose build/macos/Archipelago.app
|
||||
|
||||
- name: Notarize (if credentials available)
|
||||
if: ${{ secrets.APPLE_ID != '' }}
|
||||
env:
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
APPLE_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }}
|
||||
run: |
|
||||
# Create zip for notarization
|
||||
ditto -c -k --keepParent build/macos/Archipelago.app Archipelago.zip
|
||||
|
||||
# Submit for notarization
|
||||
xcrun notarytool submit Archipelago.zip \
|
||||
--apple-id "$APPLE_ID" \
|
||||
--team-id "$APPLE_TEAM_ID" \
|
||||
--password "$APPLE_APP_PASSWORD" \
|
||||
--wait
|
||||
|
||||
# Staple
|
||||
xcrun stapler staple build/macos/Archipelago.app
|
||||
|
||||
# Recreate DMG with notarized app
|
||||
rm -f build/macos/Archipelago-${{ steps.version.outputs.VERSION }}-macOS.dmg
|
||||
hdiutil create -volname "Archipelago ${{ steps.version.outputs.VERSION }}" \
|
||||
-srcfolder build/macos/Archipelago.app \
|
||||
-ov -format UDZO \
|
||||
build/macos/Archipelago-${{ steps.version.outputs.VERSION }}-macOS.dmg
|
||||
|
||||
xcrun stapler staple build/macos/Archipelago-${{ steps.version.outputs.VERSION }}-macOS.dmg
|
||||
|
||||
- name: Create checksums
|
||||
working-directory: build/macos
|
||||
run: |
|
||||
if [ -f "Archipelago-${{ steps.version.outputs.VERSION }}-macOS.dmg" ]; then
|
||||
shasum -a 256 "Archipelago-${{ steps.version.outputs.VERSION }}-macOS.dmg" > checksums.txt
|
||||
fi
|
||||
cat checksums.txt || echo "No DMG to checksum"
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Archipelago-${{ steps.version.outputs.VERSION }}-macOS
|
||||
path: |
|
||||
build/macos/Archipelago.app
|
||||
build/macos/*.dmg
|
||||
build/macos/checksums.txt
|
||||
retention-days: 30
|
||||
|
||||
- name: Create GitHub Release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: |
|
||||
build/macos/Archipelago-${{ steps.version.outputs.VERSION }}-macOS.dmg
|
||||
build/macos/checksums.txt
|
||||
draft: true
|
||||
generate_release_notes: true
|
||||
body: |
|
||||
## Archipelago v${{ steps.version.outputs.VERSION }}
|
||||
|
||||
### 🎉 macOS Release
|
||||
|
||||
**Download**: `Archipelago-${{ steps.version.outputs.VERSION }}-macOS.dmg`
|
||||
|
||||
### Installation
|
||||
1. Download the DMG file
|
||||
2. Open and drag Archipelago to Applications
|
||||
3. Install [Docker Desktop](https://www.docker.com/products/docker-desktop)
|
||||
4. Launch Archipelago
|
||||
|
||||
### What's New
|
||||
See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md)
|
||||
|
||||
### System Requirements
|
||||
- macOS 10.15 (Catalina) or later
|
||||
- 8GB RAM minimum (16GB recommended)
|
||||
- Docker Desktop 23.0+
|
||||
|
||||
### Checksums
|
||||
See `checksums.txt` for SHA-256 verification
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
test-build:
|
||||
name: Test Build (No Artifacts)
|
||||
runs-on: macos-latest
|
||||
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- name: Test backend build
|
||||
working-directory: core
|
||||
run: cargo build --release
|
||||
|
||||
- name: Test frontend build
|
||||
working-directory: neode-ui
|
||||
run: |
|
||||
npm ci
|
||||
npm run build:production
|
||||
@@ -0,0 +1,65 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
env:
|
||||
RUST_VERSION: stable
|
||||
NODE_VERSION: 18
|
||||
|
||||
jobs:
|
||||
rust:
|
||||
name: Rust (fmt + clippy + test)
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: core
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ env.RUST_VERSION }}
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: Check formatting
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
- name: Clippy
|
||||
run: cargo clippy --all-targets --all-features -- -D warnings
|
||||
|
||||
- name: Tests
|
||||
run: cargo test --all-features
|
||||
|
||||
frontend:
|
||||
name: Frontend (type-check + lint)
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: neode-ui
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
cache: 'npm'
|
||||
cache-dependency-path: neode-ui/package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Type check
|
||||
run: npm run type-check
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
@@ -0,0 +1,74 @@
|
||||
name: Demo images
|
||||
|
||||
# Builds and pushes the public-demo images on every change to the UI / mock
|
||||
# backend, so the separated `archy-demo` Portainer stack auto-tracks the real
|
||||
# code (see demo-deploy/ and docs/demo-deployment-design.md).
|
||||
#
|
||||
# Required repo configuration:
|
||||
# vars.DEMO_REGISTRY e.g. 146.59.87.168:3000/lfg2025
|
||||
# vars.DEMO_REGISTRY_HOST registry host for docker login (no org suffix)
|
||||
# secrets.DEMO_REGISTRY_USER
|
||||
# secrets.DEMO_REGISTRY_TOKEN
|
||||
# Optional:
|
||||
# secrets.PORTAINER_WEBHOOK redeploy hook called after a successful push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'neode-ui/**'
|
||||
- 'docker-compose.demo.yml'
|
||||
- '.github/workflows/demo-images.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build & push demo images
|
||||
runs-on: ubuntu-latest
|
||||
# Skip cleanly on forks / before registry config is set.
|
||||
if: ${{ vars.DEMO_REGISTRY != '' }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
# The demo registry is plain HTTP — teach buildkit to push without TLS
|
||||
# (the host docker daemon needs it in insecure-registries for login too).
|
||||
buildkitd-config-inline: |
|
||||
[registry."${{ vars.DEMO_REGISTRY_HOST || vars.DEMO_REGISTRY }}"]
|
||||
http = true
|
||||
|
||||
- name: Log in to registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ vars.DEMO_REGISTRY_HOST || vars.DEMO_REGISTRY }}
|
||||
username: ${{ secrets.DEMO_REGISTRY_USER }}
|
||||
password: ${{ secrets.DEMO_REGISTRY_TOKEN }}
|
||||
|
||||
- name: Build & push backend
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: neode-ui/Dockerfile.backend
|
||||
push: true
|
||||
tags: |
|
||||
${{ vars.DEMO_REGISTRY }}/archy-demo-backend:demo
|
||||
${{ vars.DEMO_REGISTRY }}/archy-demo-backend:${{ github.sha }}
|
||||
|
||||
- name: Build & push web
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: neode-ui/Dockerfile.web
|
||||
push: true
|
||||
build-args: |
|
||||
VITE_DEMO=1
|
||||
tags: |
|
||||
${{ vars.DEMO_REGISTRY }}/archy-demo-web:demo
|
||||
${{ vars.DEMO_REGISTRY }}/archy-demo-web:${{ github.sha }}
|
||||
|
||||
- name: Trigger Portainer redeploy
|
||||
if: ${{ success() && secrets.PORTAINER_WEBHOOK != '' }}
|
||||
run: curl -fsS -X POST "${{ secrets.PORTAINER_WEBHOOK }}"
|
||||
Reference in New Issue
Block a user