mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2024-11-16 10:52:44 +00:00
225 lines
5.8 KiB
YAML
225 lines
5.8 KiB
YAML
name: Release
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
build-linux-x86_64:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Install dependencies
|
|
run: sudo apt-get update && sudo apt-get install libasound2-dev libudev-dev pkg-config
|
|
|
|
- name: Cache Cargo registry
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.cargo/registry
|
|
key: ${{ runner.os }}-stable-cargo-registry
|
|
restore-keys: |
|
|
${{ runner.os }}-stable-cargo-registry-
|
|
|
|
- name: Cache Cargo index
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.cargo/git
|
|
key: ${{ runner.os }}-stable-cargo-index
|
|
restore-keys: |
|
|
${{ runner.os }}-stable-cargo-index-
|
|
|
|
- name: Cache Cargo build
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: target
|
|
key: ${{ runner.os }}-stable-target
|
|
restore-keys: |
|
|
${{ runner.os }}-stable-target
|
|
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Checkout data files
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: doukutsu-rs/game-data
|
|
path: data
|
|
|
|
- name: Install latest stable Rust toolchain
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
default: true
|
|
override: true
|
|
|
|
- name: Build
|
|
run: cargo build --all --release && strip target/release/doukutsu-rs
|
|
|
|
- name: Copy executable to root directory
|
|
run: cp target/release/doukutsu-rs doukutsu-rs.x86_64
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: doukutsu-rs_linux_x86_64
|
|
path: |
|
|
doukutsu-rs.x86_64
|
|
data
|
|
!data/README.md
|
|
if-no-files-found: error
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v1
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
files: |
|
|
doukutsu-rs.x86_64
|
|
data
|
|
!data/.git
|
|
!data/README.md
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
build-windows-x86:
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- name: Cache Cargo registry
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.cargo/registry
|
|
key: ${{ runner.os }}-stable-cargo-registry
|
|
restore-keys: |
|
|
${{ runner.os }}-stable-cargo-registry-
|
|
|
|
- name: Cache Cargo index
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.cargo/git
|
|
key: ${{ runner.os }}-stable-cargo-index
|
|
restore-keys: |
|
|
${{ runner.os }}-stable-cargo-index-
|
|
|
|
- name: Cache Cargo build
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: target
|
|
key: ${{ runner.os }}-stable-target
|
|
restore-keys: |
|
|
${{ runner.os }}-stable-target
|
|
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Checkout data files
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: doukutsu-rs/game-data
|
|
path: data
|
|
|
|
- name: Install latest stable Rust toolchain
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
target: i686-pc-windows-msvc
|
|
default: true
|
|
override: true
|
|
|
|
- name: Build
|
|
run: cargo build --target i686-pc-windows-msvc --all --release
|
|
|
|
- name: Copy executable to root directory
|
|
run: cp target/i686-pc-windows-msvc/release/doukutsu-rs.exe doukutsu-rs.exe
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: doukutsu-rs_windows_x86
|
|
path: |
|
|
doukutsu-rs.exe
|
|
data
|
|
!data/.git
|
|
!data/README.md
|
|
if-no-files-found: error
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v1
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
files: |
|
|
doukutsu-rs.exe
|
|
data
|
|
!data/README.md
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
build-windows-x64:
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- name: Cache Cargo registry
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.cargo/registry
|
|
key: ${{ runner.os }}-stable-cargo-registry
|
|
restore-keys: |
|
|
${{ runner.os }}-stable-cargo-registry-
|
|
|
|
- name: Cache Cargo index
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.cargo/git
|
|
key: ${{ runner.os }}-stable-cargo-index
|
|
restore-keys: |
|
|
${{ runner.os }}-stable-cargo-index-
|
|
|
|
- name: Cache Cargo build
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: target
|
|
key: ${{ runner.os }}-stable-target
|
|
restore-keys: |
|
|
${{ runner.os }}-stable-target
|
|
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Checkout data files
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: doukutsu-rs/game-data
|
|
path: data
|
|
|
|
- name: Install latest stable Rust toolchain
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
default: true
|
|
override: true
|
|
|
|
- name: Build
|
|
run: cargo build --all --release
|
|
|
|
- name: Copy executable to root directory
|
|
run: cp target/release/doukutsu-rs.exe doukutsu-rs.exe
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: doukutsu-rs_windows_x64
|
|
path: |
|
|
doukutsu-rs.exe
|
|
data
|
|
!data/.git
|
|
!data/README.md
|
|
if-no-files-found: error
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v1
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
files: |
|
|
doukutsu-rs.exe
|
|
data
|
|
!data/README.md
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|