Skip to content

core: Fix sync build #235

core: Fix sync build

core: Fix sync build #235

Workflow file for this run

on:
push:
branches:
- main
tags:
- v*
pull_request:
name: Build
jobs:
build_lib:
name: Build (xdvdfs)
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: -p xdvdfs
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: -p xdvdfs
build_cli_linux:
name: Build for Linux (xdvdfs-cli)
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: -p xdvdfs-cli --release
- name: Package artifact
run: zip -j xdvdfs-linux-${{ github.sha }}.zip LICENSE target/release/xdvdfs
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: xdvdfs-linux-${{ github.sha }}
path: xdvdfs-linux-${{ github.sha }}.zip
build_cli_windows:
name: Build for Windows (xdvdfs-cli)
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: x86_64-pc-windows-gnu
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: -p xdvdfs-cli --release --target=x86_64-pc-windows-gnu
use-cross: true
- name: Package artifact
run: zip -j xdvdfs-windows-${{ github.sha }}.zip LICENSE target/x86_64-pc-windows-gnu/release/xdvdfs.exe
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: xdvdfs-windows-${{ github.sha }}
path: xdvdfs-windows-${{ github.sha }}.zip
build_web:
name: Build (web)
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
target: wasm32-unknown-unknown
- name: Install Trunk
uses: jetli/[email protected]
with:
version: 'latest'
- name: Build
run: trunk build --release
working-directory: ./xdvdfs-web
- name: Package artifact
run: zip xdvdfs-web-${{ github.sha }}.zip -r dist
working-directory: ./xdvdfs-web
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: xdvdfs-web-${{ github.sha }}
path: xdvdfs-web/xdvdfs-web-${{ github.sha }}.zip
build_desktop:
strategy:
matrix:
platform: [macos-latest, ubuntu-22.04, windows-latest]
name: Build desktop for ${{ matrix.platform }}
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
- name: Install Trunk
uses: jetli/[email protected]
with:
version: 'latest'
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: Build
id: build
uses: tauri-apps/tauri-action@v0
with:
projectPath: ./xdvdfs-desktop
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: xdvdfs-desktop-${{ matrix.platform }}-${{ github.sha }}
path: |
target/release/bundle/deb/*.deb
target/release/bundle/appimage/*.AppImage
target/release/bundle/dmg/*.dmg
target/release/bundle/msi/*.msi
target/release/bundle/nsis/*.exe
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [build_cli_linux, build_cli_windows, build_web]
permissions:
contents: write
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: out
# Get latest two tags, reverse order, then get log between those tags
- name: Generate release notes
run: git tag --sort=-version:refname | head -n 2 | tac | sed 'N;s/\n/../' | xargs git log --oneline --no-decorate | tee ${{ github.workspace }}-changelog.txt
- name: Publish release
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: false
body_path: ${{ github.workspace }}-changelog.txt
files: |
out/**/*.zip