Merge pull request #15 from FluffyGhoster/2.1.0+a5 #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: rust-g | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: i686-pc-windows-msvc | |
components: rustfmt, clippy | |
- uses: Swatinem/rust-cache@v2 | |
- name: Clippy (all features) | |
uses: actions-rs/cargo@v1 | |
with: | |
toolchain: stable | |
command: clippy | |
args: --target i686-pc-windows-msvc --all-features --locked | |
- name: Rustfmt | |
uses: actions-rs/cargo@v1 | |
with: | |
toolchain: stable | |
command: fmt | |
args: -- --check | |
- name: Build (release) (default features) | |
uses: actions-rs/cargo@v1 | |
with: | |
toolchain: stable | |
command: build | |
args: --target i686-pc-windows-msvc --release | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Windows Build | |
path: | | |
target/i686-pc-windows-msvc/release/rust_g.dll | |
target/i686-pc-windows-msvc/release/rust_g.pdb | |
target/rust_g.dm | |
build-linux: | |
runs-on: ubuntu-latest | |
env: | |
BYOND_MAJOR: 515 | |
BYOND_MINOR: 1602 | |
PKG_CONFIG_ALLOW_CROSS: 1 | |
steps: | |
- uses: actions/checkout@v2 | |
- run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
sudo apt-get install -y libgcc-s1:i386 g++-multilib zlib1g-dev:i386 libssl-dev:i386 | |
./scripts/install_byond.sh | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: i686-unknown-linux-gnu | |
- uses: Swatinem/rust-cache@v2 | |
- name: Check (all features) | |
uses: actions-rs/cargo@v1 | |
with: | |
toolchain: stable | |
command: check | |
args: --target i686-unknown-linux-gnu --all-features | |
- name: Build (Debug) (all features) | |
uses: actions-rs/cargo@v1 | |
with: | |
toolchain: stable | |
command: build | |
args: --target i686-unknown-linux-gnu --all-features | |
- name: Run tests (all features) | |
uses: actions-rs/cargo@v1 | |
with: | |
toolchain: stable | |
command: test | |
args: --target i686-unknown-linux-gnu --all-features | |
env: | |
BYOND_BIN: /home/runner/BYOND/byond/bin | |
- name: Build (release) (default features) | |
uses: actions-rs/cargo@v1 | |
with: | |
toolchain: stable | |
command: build | |
args: --target i686-unknown-linux-gnu --release | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Linux Build | |
path: | | |
target/i686-unknown-linux-gnu/release/librust_g.so | |
target/rust_g.dm | |
deploy: | |
name: Create Release | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: [build-windows, build-linux] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- uses: actions/download-artifact@v2 | |
with: | |
name: Windows Build | |
- name: Upload rust_g.dll (Windows) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./i686-pc-windows-msvc/release/rust_g.dll | |
asset_name: rust_g.dll | |
asset_content_type: application/octet-stream | |
- name: Upload rust_g.pdb (Windows) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./i686-pc-windows-msvc/release/rust_g.pdb | |
asset_name: rust_g.pdb | |
asset_content_type: application/octet-stream | |
- uses: actions/download-artifact@v2 | |
with: | |
name: Linux Build | |
- name: Upload librust_g.so (Linux) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./i686-unknown-linux-gnu/release/librust_g.so | |
asset_name: librust_g.so | |
asset_content_type: application/octet-stream | |
- uses: actions/download-artifact@v2 | |
with: | |
name: Windows Build | |
- name: Upload rust_g.dm | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./rust_g.dm | |
asset_name: rust_g.dm | |
asset_content_type: text/plain |