Skip to content
Snippets Groups Projects
deploy.yml 4.07 KiB
name: Deploy Workflow
on: [push]
#on:
#  push:
#    tags:
#      - "*"
jobs:
  build-linux:
    name: Build Linux
    timeout-minutes: 30
    runs-on: ubuntu-latest
    container: rust:1.71.0
    steps:
      - name: Checkout code from repository
        uses: actions/checkout@v3
      - name: Build Base
        run: |
          cargo build --release
      - name: Build SDL
        run: |
          cd frontends/sdl
          apt-get update && apt-get install -y -q zip
          cargo install cargo-vcpkg && cargo vcpkg -v build
          cargo build --release
      - name: Build Libretro
        run: |
          cd frontends/libretro
          cargo build --release
      - name: Transform filenames
        run: |
          cd target/release
          mv boytacean-sdl boytacean-sdl-linux-x64
          mv libboytacean_libretro.so boytacean_libretro.so
      - name: Upload artifacts
        uses: actions/upload-artifact@v3
        with:
          name: boytacean-linux
          path: |
            target/release/boytacean-sdl-linux-x64
            target/release/libboytacean.so
            target/release/boytacean_libretro.so
          retention-days: 5
  build-windows:
    name: Build Windows
    timeout-minutes: 30
    runs-on: windows-latest
    steps:
      - name: Checkout code from repository
        uses: actions/checkout@v3
      - name: Setup Rust
        run: |
          rustup install 1.71.0
          rustup override set 1.71.0
          rustup default stable-msvc
      - name: Build Base
        run: |
          cargo build --release
      - name: Build SDL
        run: |
          cd frontends/sdl
          cargo install cargo-vcpkg && cargo vcpkg -v build
          cargo build --release
      - name: Build Libretro
        run: |
          cd frontends/libretro
          cargo build --release
      - name: Transform filenames
        run: |
          cd target/release
          mv boytacean-sdl.exe boytacean-sdl-win32-x64.exe