🐞 fix: Update action definitions

This commit is contained in:
Keith Solomon
2026-02-27 11:29:37 -06:00
parent 5299190973
commit c893459321
2 changed files with 33 additions and 114 deletions

View File

@@ -1,10 +1,11 @@
name: CI name: CI
on: on:
push: workflow_dispatch:
branches: [main] # push:
pull_request: # branches: [main]
branches: [main] # pull_request:
# branches: [main]
jobs: jobs:
backend: backend:

View File

@@ -6,127 +6,45 @@ on:
- 'v*' - 'v*'
permissions: permissions:
contents: write contents: read
packages: write
jobs: jobs:
build: docker:
name: Build ${{ matrix.name }} name: Build and Push Docker Image
runs-on: ${{ matrix.os }} runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: Linux (x86_64)
target: x86_64-unknown-linux-gnu
os: ubuntu-latest
archive: tar.gz
asset_name: ironpad-linux-x86_64
- name: macOS (x86_64)
target: x86_64-apple-darwin
os: macos-latest
archive: tar.gz
asset_name: ironpad-macos-x86_64
- name: Windows (x86_64)
target: x86_64-pc-windows-msvc
os: windows-latest
archive: zip
asset_name: ironpad-windows-x86_64
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install Rust toolchain - name: Set image name
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y cmake libdbus-1-dev pkg-config
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Build frontend
working-directory: frontend
run: |
npm ci
npm run build
- name: Copy frontend to static
shell: bash shell: bash
run: | run: echo "IMAGE_NAME=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/ironpad" >> "$GITHUB_ENV"
mkdir -p backend/static
cp -r frontend/dist/* backend/static/
- name: Build backend (release) - name: Set up Docker Buildx
working-directory: backend uses: docker/setup-buildx-action@v3
run: cargo build --release --target ${{ matrix.target }}
- name: Package (Unix) - name: Log in to GHCR
if: matrix.archive == 'tar.gz' uses: docker/login-action@v3
shell: bash
run: |
RELEASE_DIR="${{ matrix.asset_name }}-${{ github.ref_name }}"
mkdir -p "$RELEASE_DIR"
cp "backend/target/${{ matrix.target }}/release/ironpad" "$RELEASE_DIR/"
cp -r backend/static "$RELEASE_DIR/static"
cp README.md LICENSE "$RELEASE_DIR/"
tar czf "$RELEASE_DIR.tar.gz" "$RELEASE_DIR"
echo "ASSET=$RELEASE_DIR.tar.gz" >> $GITHUB_ENV
- name: Package (Windows)
if: matrix.archive == 'zip'
shell: bash
run: |
RELEASE_DIR="${{ matrix.asset_name }}-${{ github.ref_name }}"
mkdir -p "$RELEASE_DIR"
cp "backend/target/${{ matrix.target }}/release/ironpad.exe" "$RELEASE_DIR/"
cp -r backend/static "$RELEASE_DIR/static"
cp README.md LICENSE "$RELEASE_DIR/"
7z a "$RELEASE_DIR.zip" "$RELEASE_DIR"
echo "ASSET=$RELEASE_DIR.zip" >> $GITHUB_ENV
- name: Upload artifact
uses: actions/upload-artifact@v4
with: with:
name: ${{ matrix.asset_name }} registry: ghcr.io
path: ${{ env.ASSET }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
release: - name: Docker metadata
name: Create Release id: meta
needs: build uses: docker/metadata-action@v5
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with: with:
path: artifacts images: ${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag
type=raw,value=latest,enable=${{ !contains(github.ref_name, '-') }}
- name: Create GitHub Release - name: Build and push image
uses: softprops/action-gh-release@v2 uses: docker/build-push-action@v6
with: with:
name: Ironpad ${{ github.ref_name }} context: .
body: | file: ./Dockerfile
## Downloads push: true
tags: ${{ steps.meta.outputs.tags }}
| Platform | File | labels: ${{ steps.meta.outputs.labels }}
|----------|------|
| Windows (x86_64) | `ironpad-windows-x86_64-${{ github.ref_name }}.zip` |
| macOS (x86_64) | `ironpad-macos-x86_64-${{ github.ref_name }}.tar.gz` |
| Linux (x86_64) | `ironpad-linux-x86_64-${{ github.ref_name }}.tar.gz` |
**Linux:** Extract the tar.gz and run `./ironpad`. Works on any distro -- it's a standalone binary with no dependencies.
**macOS:** Extract and run. You may need to allow it in System Settings > Privacy & Security on first launch.
**Windows:** Extract the zip and run `ironpad.exe`.
---
files: artifacts/**/*
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}