Merge pull request #19 from Tiaansu/master #5
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: Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
env: | |
RELEASE_BIN: pawn_json | |
RELEASE_ADDS: json.inc | |
RUST: stable-i686 | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust (rustup) | |
run: rustup update ${{ env.RUST }} --no-self-update && rustup default ${{ env.RUST }} | |
- name: Build | |
run: cargo build --release | |
- name: Rename binary | |
run: cp .\target\release\${{ env.RELEASE_BIN }}.dll .\target\release\json.dll | |
- name: Create artifacts directory | |
run: | | |
mkdir artifacts/plugins | |
mkdir artifacts/pawno/include | |
- name: Copy files to artifacts directory | |
run: | | |
cp .\target\release\json.dll .\artifacts\plugins\json.dll | |
cp .\${{ env.RELEASE_ADDS }} .\artifacts\pawno\include\${{ env.RELEASE_ADDS }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: json-windows | |
path: artifacts/ | |
build-linux: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install gcc-multilib | |
run: sudo apt update && sudo apt install gcc-multilib -y | |
- name: Install Rust (rustup) | |
run: rustup update ${{ env.RUST }} --no-self-update && rustup default ${{ env.RUST }} | |
- name: Build | |
run: cargo build --release | |
- name: Rename binary | |
run: cp target/release/lib${{ env.RELEASE_BIN }}.so target/release/json.so | |
- name: Create artifacts directory | |
run: | | |
mkdir -p artifacts/plugins | |
mkdir -p artifacts/pawno/include | |
- name: Copy files to artifacts directory | |
run: | | |
cp target/release/json.so artifacts/plugins/json.so | |
cp ${{ env.RELEASE_ADDS }} artifacts/pawno/include/${{ env.RELEASE_ADDS }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: json-linux | |
path: artifacts/ |