1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2024-11-09 15:54:24 +00:00
doukutsu-rs/.github/workflows/release.yml

152 lines
3.9 KiB
YAML
Raw Normal View History

2020-09-22 20:21:04 +00:00
name: Release
on: [push]
jobs:
2020-09-22 20:43:45 +00:00
build-linux:
2020-09-22 20:21:04 +00:00
runs-on: ubuntu-latest
steps:
2020-09-22 20:43:45 +00:00
- name: Install dependencies
run: sudo apt-get install libasound2-dev libudev-dev pkg-config
2020-09-22 20:48:19 +00:00
- name: Cache Cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
2020-09-23 13:14:39 +00:00
key: ${{ runner.os }}-stable-cargo-registry
2020-09-22 20:48:19 +00:00
restore-keys: |
${{ runner.os }}-stable-cargo-registry-
- name: Cache Cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
2020-09-23 13:14:39 +00:00
key: ${{ runner.os }}-stable-cargo-index
2020-09-22 20:48:19 +00:00
restore-keys: |
${{ runner.os }}-stable-cargo-index-
- name: Cache Cargo build
uses: actions/cache@v2
with:
2020-09-23 13:14:39 +00:00
path: target
key: ${{ runner.os }}-stable-target
2020-09-22 20:48:19 +00:00
restore-keys: |
2020-09-23 13:14:39 +00:00
${{ runner.os }}-stable-target
2020-09-22 20:48:19 +00:00
2020-09-22 20:21:04 +00:00
- 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
2020-09-22 20:43:45 +00:00
- name: Copy executable to root directory
run: cp target/release/doukutsu-rs doukutsu-rs.x86_64
2020-09-22 20:21:04 +00:00
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
2020-09-22 20:43:45 +00:00
name: doukutsu-rs_linux_amd64
2020-09-22 20:21:04 +00:00
path: |
2020-09-22 20:43:45 +00:00
doukutsu-rs.x86_64
2020-09-22 20:21:04 +00:00
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: |
2020-09-22 20:43:45 +00:00
doukutsu-rs.x86_64
2020-09-22 20:21:04 +00:00
data
!data/.git
2020-09-22 20:21:04 +00:00
!data/README.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2020-09-22 20:43:45 +00:00
build-windows:
2020-09-22 20:21:04 +00:00
runs-on: windows-latest
steps:
2020-09-22 20:48:19 +00:00
- name: Cache Cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
2020-09-23 13:14:39 +00:00
key: ${{ runner.os }}-stable-cargo-registry
2020-09-22 20:48:19 +00:00
restore-keys: |
${{ runner.os }}-stable-cargo-registry-
- name: Cache Cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
2020-09-23 13:14:39 +00:00
key: ${{ runner.os }}-stable-cargo-index
2020-09-22 20:48:19 +00:00
restore-keys: |
${{ runner.os }}-stable-cargo-index-
- name: Cache Cargo build
uses: actions/cache@v2
with:
2020-09-23 13:14:39 +00:00
path: target
key: ${{ runner.os }}-stable-target
2020-09-22 20:48:19 +00:00
restore-keys: |
2020-09-23 13:14:39 +00:00
${{ runner.os }}-stable-target
2020-09-22 20:48:19 +00:00
2020-09-22 20:21:04 +00:00
- 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
2020-09-22 20:43:45 +00:00
- name: Copy executable to root directory
run: cp target/release/doukutsu-rs.exe doukutsu-rs.exe
2020-09-22 20:21:04 +00:00
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
2020-09-22 20:43:45 +00:00
name: doukutsu-rs_windows_x64
2020-09-22 20:21:04 +00:00
path: |
2020-09-22 20:43:45 +00:00
doukutsu-rs.exe
2020-09-22 20:21:04 +00:00
data
!data/.git
2020-09-22 20:21:04 +00:00
!data/README.md
if-no-files-found: error
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
2020-09-22 20:43:45 +00:00
doukutsu-rs.exe
2020-09-22 20:21:04 +00:00
data
!data/README.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}