Files
friendolls/.github/workflows/release.yml
T

116 lines
3.4 KiB
YAML

name: Release
on:
push:
branches: [release]
permissions:
contents: write
packages: write
jobs:
changes:
runs-on: ubuntu-latest
outputs:
desktop: ${{ steps.filter.outputs.desktop }}
server: ${{ steps.filter.outputs.server }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
base: ${{ github.ref }}
filters: |
desktop:
- 'src/**'
- 'src-tauri/**'
- 'messages/**'
- 'project.inlang/**'
- 'scripts/check-i18n.mjs'
- 'package.json'
- 'bun.lock'
- 'svelte.config.js'
- 'tsconfig.json'
- 'vite.config.js'
- 'Cargo.toml'
- 'Cargo.lock'
- 'src-common/**'
- '.gitattributes'
- '.github/workflows/**'
server:
- 'src-server/**'
- 'Dockerfile'
- 'Cargo.toml'
- 'Cargo.lock'
- 'src-common/**'
- '.github/workflows/**'
desktop:
needs: changes
if: needs.changes.outputs.desktop == 'true'
strategy:
fail-fast: false
matrix:
include:
- platform: macos-15
rust_target: aarch64-apple-darwin
args: --target aarch64-apple-darwin
- platform: macos-15-intel
rust_target: x86_64-apple-darwin
args: --target x86_64-apple-darwin
- platform: windows-latest
rust_target: ""
args: ""
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.rust_target }}
- name: Cache Bun packages
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-${{ runner.arch }}-bun-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-bun-
- uses: Swatinem/rust-cache@v2.9.2
with:
shared-key: ${{ matrix.rust_target || 'native' }}
- run: bun install --frozen-lockfile
- name: Build and upload Tauri bundles
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with:
tagName: v__VERSION__
releaseName: v__VERSION__
releaseBody: See the "Assets" below for downloads.
releaseDraft: false
prerelease: false
args: ${{ matrix.args }}
server:
needs: changes
if: needs.changes.outputs.server == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ghcr.io/wind-explorer/friendolls-server:latest
cache-from: type=gha,scope=server
cache-to: type=gha,mode=max,scope=server