Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiaansu committed Sep 25, 2024
1 parent 85c78c8 commit 9692dbf
Show file tree
Hide file tree
Showing 10 changed files with 920 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build

on:
push:
branches:
- main
pull_request:
branches:
- master

env:
RELEASE_BIN: samp_cron
RELEASE_ADDS: README.md LICENSE include/samp_cron.inc

jobs:
build:
name: Build release

runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux, windows]
include:
- build: linux
os: ubuntu-20.04
rust: stable-i686
- build: windows
os: windows-latest
rust: stable-i686

steps:
- uses: actions/checkout@v4

- name: Install gcc-multilib
run: |
sudo apt update
sudo apt install gcc-multilib -y
if: matrix.os == 'ubuntu-20.04'

- name: Install Rust (rustup)
run: rustup update ${{ matrix.os }} --no-self-update && rustup default ${{ matrix.rust }}
shell: bash

- name: Build
run: cargo build --verbose --release

- name: Create artifact directory
run: mkdir artifacts

- name: Create archive for Linux
run: 7z a -ttar -so -an ./target/release/lib${{ env.RELEASE_BIN }}.so ${{ env.RELEASE_ADDS }} | 7z a -si ./artifacts/${{ env.RELEASE_BIN }}=linux-x86.tar.gz
if: matrix.os == 'ubuntu-20.04'

- name: Create archive for Windows
run: 7z a -tzip ./artifacts/${{ env.RELEASE_BIN }}-windows-x86.zip ./target/release/${{ env.RELEASE_BIN }}.dll ${{ env.RELEASE_ADDS }}
if: matrix.os == 'windows-latest'

- uses: actions/upload-artifact@v4
name: Upload archive
with:
name: ${{ runner.os }}
path: artifacts/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
Loading

0 comments on commit 9692dbf

Please sign in to comment.