Redlib build #3
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: Redlib build | |
on: [workflow_dispatch] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3.3.0 | |
- run: sudo apt-get install -y git tar zip mingw-w64 | |
- uses: brndnmtthws/rust-action-rustup@v1.0.0 | |
with: | |
targets: x86_64-unknown-linux-gnu x86_64-pc-windows-gnu | |
- run: | | |
mkdir redlib | |
cd redlib/ | |
REPO=https://github.com/redlib-org/redlib/ | |
git clone $REPO --single-branch --branch $(git ls-remote --tags $REPO | cut -d/ -f3 | sort -V | tail -n1) | |
cd redlib/ | |
cargo build --target x86_64-unknown-linux-gnu --release | |
mv target/x86_64-unknown-linux-gnu/release/redlib ../redlib_linux_x86_64 | |
cargo build --target x86_64-pc-windows-gnu --release | |
mv target/x86_64-pc-windows-gnu/release/redlib.exe ../redlib_windows_x86_64.exe | |
cd ../../ | |
tar -czvf redlib_linux_x86_64.tar.gz ./redlib/redlib_linux_x86_64 | |
zip redlib_windows_x86_64.zip ./redlib/redlib_windows_x86_64.exe | |
mv redlib_linux_x86_64.tar.gz binaries/ | |
mv redlib_windows_x86_64.zip binaries/ | |
rm -fr redlib/ | |
- run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add -A | |
git commit -m "Update RedLib binaries" | |
- uses: ad-m/github-push-action@v0.6.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main |