added action workflow

This commit is contained in:
Valmo Trindade
2024-12-20 00:58:26 -03:00
parent c702397c8d
commit c0c8932bbc

View File

@@ -5,59 +5,71 @@ on:
branches: branches:
- dev - dev
pull_request: pull_request:
branches: [ main, dev ] branches: [action]
jobs: jobs:
build_extension: build_extension:
strategy: strategy:
matrix: matrix:
arrays: [ os_target:
os: { tag: "windows-latest", target: "i686-pc-windows-msvc" }, - { os: "windows-latest", target: "i686-pc-windows-msvc", artifact: "armatak.dll" }
os: { tag: "windows-latest", target: "x86_64-pc-windows-msvc" }, - { os: "windows-latest", target: "x86_64-pc-windows-msvc", artifact: "armatak_x64.dll" }
] - { os: "ubuntu-latest", target: "x86_64-unknown-linux-gnu", artifact: "armatak.so" }
runs-on: ${{ matrix.arrays.os.tag }} runs-on: ${{ matrix.os_target.os }}
steps: steps:
- name: Checkout Repo - name: Checkout Repo
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
lfs: true lfs: true
- name: Install latest - name: Install Rust Toolchain
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
target: ${{ matrix.arrays.os.target }} target: ${{ matrix.os_target.target }}
toolchain: stable toolchain: stable
default: true default: true
- name: Install Dependencies (Linux only)
if: matrix.os_target.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install -y build-essential
- name: Cargo Build - name: Cargo Build
run: cargo build --release run: cargo build --release --target ${{ matrix.os_target.target }}
- name: Upload - name: Upload Artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: ${{ matrix.arrays.os.target }} name: ${{ matrix.os_target.target }}
path: target/release/armatak.dll path: target/${{ matrix.os_target.target }}/release/${{ matrix.os_target.artifact }}
if-no-files-found: error if-no-files-found: error
retention-days: 7 retention-days: 7
package: package:
needs: build_extension needs: build_extension
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - name: Checkout Repo
uses: actions/checkout@v4
with: with:
lfs: true lfs: true
- run: mkdir ./target - run: mkdir -p ./target/release
- run: mkdir ./target/release - name: Download Windows x64 Artifact
- uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
name: x86_64-pc-windows-msvc name: x86_64-pc-windows-msvc
- run: mv ./armatak.dll ./target/release/armatak_x64.dll - run: mv ./armatak_x64.dll ./target/release/armatak_x64.dll
- uses: actions/download-artifact@v4 - name: Download Windows x86 Artifact
uses: actions/download-artifact@v4
with: with:
name: i686-pc-windows-msvc name: i686-pc-windows-msvc
- run: mv ./armatak.dll ./target/release/armatak.dll - run: mv ./armatak.dll ./target/release/armatak.dll
- name: Download Linux x64 Artifact
uses: actions/download-artifact@v4
with:
name: x86_64-unknown-linux-gnu
- run: mv ./armatak.so ./target/release/armatak.so
- name: Setup HEMTT - name: Setup HEMTT
uses: arma-actions/hemtt@v1 uses: arma-actions/hemtt@v1
- name: Build - name: Build
run: hemtt release run: hemtt release
- uses: actions/upload-artifact@v4 - name: Upload Final Package
uses: actions/upload-artifact@v4
with: with:
name: armatak.zip name: armatak.zip
path: 'releases/armatak-latest.zip' path: 'releases/armatak-latest.zip'