Skip to content

build

build #45

Workflow file for this run

name: build
on:
push:
tags:
- "v*.*.*"
env:
CARGO_TERM_COLOR: always
jobs:
build_linux32:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_i686
defaults:
run:
shell: sh
steps:
- uses: actions/checkout@v1
- name: Install Rust
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-host i686-unknown-linux-gnu --default-toolchain nightly-2023-01-01 --profile minimal -y
- name: Build 32-bit
run: |
source $HOME/.cargo/env
cargo build --release --target i686-unknown-linux-gnu
- name: Strip debug symbols
run: strip target/i686-unknown-linux-gnu/release/libgmsv_reqwest.so
- name: Rename binaries
run: mkdir target/i686-unknown-linux-gnu/release/bin && mv target/i686-unknown-linux-gnu/release/libgmsv_reqwest.so target/i686-unknown-linux-gnu/release/bin/gmsv_reqwest_linux.dll
- name: Release
uses: fnkr/github-action-ghr@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GHR_PATH: target/i686-unknown-linux-gnu/release/bin
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
build_linux64:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64
steps:
- name: Install Node
run: yum install nodejs npm -y
- uses: actions/checkout@v2
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2023-01-01
override: true
- name: Build 64-bit
run: cargo build --release --target x86_64-unknown-linux-gnu
- name: Strip debug symbols
run: strip target/x86_64-unknown-linux-gnu/release/libgmsv_reqwest.so
- name: Rename binaries
run: mv target/x86_64-unknown-linux-gnu/release/libgmsv_reqwest.so target/x86_64-unknown-linux-gnu/release/gmsv_reqwest_linux64.dll
- name: Release
uses: softprops/action-gh-release@v1
with:
files: target/x86_64-unknown-linux-gnu/release/gmsv_reqwest_linux64.dll
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Install nightly toolchain
run: rustup toolchain install nightly-2023-01-01
- name: Add targets
run: rustup target add x86_64-pc-windows-msvc && rustup target add i686-pc-windows-msvc
- name: Build 64-bit
run: cargo build --release --target x86_64-pc-windows-msvc
env:
RUSTFLAGS: -Ctarget-feature=+crt-static
- name: Build 32-bit
run: cargo build --release --target i686-pc-windows-msvc
env:
RUSTFLAGS: -Ctarget-feature=+crt-static
- name: Rename binaries
run: |
mv target/i686-pc-windows-msvc/release/gmsv_reqwest.dll target/i686-pc-windows-msvc/release/gmsv_reqwest_win32.dll
mv target/x86_64-pc-windows-msvc/release/gmsv_reqwest.dll target/x86_64-pc-windows-msvc/release/gmsv_reqwest_win64.dll
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
target/i686-pc-windows-msvc/release/gmsv_reqwest_win32.dll
target/x86_64-pc-windows-msvc/release/gmsv_reqwest_win64.dll
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}