name: automatic-release
on:
push:
branches:
- main
jobs:
rules-headers-tests:
name: zip up the rules directory
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build Rust Library
run: |
# doesn't need a release build since all that we want is the Rules dir and the .h files
cargo build --target x86_64-unknown-linux-gnu --features include-zip
- name: create rules.zip
uses: thedoctor0/zip-release@0.7.5
with:
type: 'zip'
filename: 'Rules.zip'
directory: 'Example'
path: 'Rules'
- name: Remove Rules dir in prep for uploading test, .h files, and Rules.zip
run: |
rm -r Example/Rules
- name: Upload Example Dir (.h files, test files)
uses: actions/upload-artifact@v4
with:
name: rules-headers-tests
path: Example
compression-level: 0
retention-days: 1
rust-32-win:
name: Build 32 bit windows dll
runs-on: windows-latest steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build 32 bit version (default)
run: cargo build --target i686-pc-windows-msvc --release
- name: Setup Example dir
run: |
cp target/i686-pc-windows-msvc/release/libmathcat_c.dll Example/
cd Example
- name: create zip file for default dll
uses: thedoctor0/zip-release@0.7.5
with:
type: 'zip'
filename: '../libmathcat_c.dll-32-win.zip'
directory: 'Example'
path: 'libmathcat_c.dll'
- name: Build 32 bit version (no-unsafe)
run: cargo build --target i686-pc-windows-msvc --release --features no-unsafe
- name: Setup Example dir for no-unsafe
run: |
cp target/i686-pc-windows-msvc/release/libmathcat_c.dll Example/
- name: create zip file for no-unsafe dll
uses: thedoctor0/zip-release@0.7.5
with:
type: 'zip'
filename: '../libmathcat_c.dll-no-unsafe-32-win.zip'
directory: 'Example'
path: 'libmathcat_c.dll'
- name: Upload 32 bit dll files
uses: actions/upload-artifact@v4
with:
name: libmathcat_c.dll-32-win
path: |
libmathcat_c.dll-32-win.zip
libmathcat_c.dll-no-unsafe-32-win.zip
compression-level: 0
retention-days: 1
rust-64-win:
name: Build 64 bit windows dll
needs: [rules-headers-tests]
runs-on: windows-latest steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build 64 bit version (default)
run: cargo build --target x86_64-pc-windows-msvc --release
- name: Download Rules.zip
uses: actions/download-artifact@v4
with:
name: rules-headers-tests
- name: Unzip Rules.zip
run: |
unzip Rules.zip -d Example
ls -l Example/Rules
- name: Setup Example dir and test build (default)
run: |
cp target/x86_64-pc-windows-msvc/release/libmathcat_c.dll Example/
cd Example
gcc test.cpp -o test -L. -llibmathcat_c
./test.exe
gcc test.c -o test -L. -llibmathcat_c
./test.exe
- name: create zip file for default dll
uses: thedoctor0/zip-release@0.7.5
with:
type: 'zip'
filename: '../libmathcat_c.dll-64-win.zip'
directory: 'Example'
path: 'libmathcat_c.dll'
- name: Build 64 bit version (no-unsafe)
run: cargo build --target x86_64-pc-windows-msvc --release --features no-unsafe
- name: Setup Example dir and test build (no-unsafe)
run: |
cp target/x86_64-pc-windows-msvc/release/libmathcat_c.dll Example/
cd Example
gcc test.cpp -o test -L. -llibmathcat_c
./test.exe
gcc test.c -o test -L. -llibmathcat_c
./test.exe
- name: create zip file for no-unsafe dll
uses: thedoctor0/zip-release@0.7.5
with:
type: 'zip'
filename: '../libmathcat_c.dll-no-unsafe-64-win.zip'
directory: 'Example'
path: 'libmathcat_c.dll'
- name: Upload 64 bit dll files
uses: actions/upload-artifact@v4
with:
name: libmathcat_c.dll-64-win
path: |
libmathcat_c.dll-64-win.zip
libmathcat_c.dll-no-unsafe-64-win.zip
compression-level: 0
retention-days: 1
rust-64-arm-win:
name: Build 64 bit arm windows dll
runs-on: windows-latest steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Add ARM Windows target
run: rustup target add aarch64-pc-windows-msvc
- name: Build 64 bit arm version (default)
run: cargo build --target aarch64-pc-windows-msvc --release
- name: Setup Example dir for default
run: |
cp target/aarch64-pc-windows-msvc/release/libmathcat_c.dll Example/
cd Example
# gcc test.cpp -o test -L. -llibmathcat_c
# ./test.exe
# gcc test.c -o test -L. -llibmathcat_c
# ./test.exe
- name: create zip file for default dll
uses: thedoctor0/zip-release@0.7.5
with:
type: 'zip'
filename: '../libmathcat_c.dll-64-arm.zip'
directory: 'Example'
path: 'libmathcat_c.dll'
- name: Build 64 bit arm version (no-unsafe)
run: cargo build --target aarch64-pc-windows-msvc --release --features no-unsafe
- name: Setup Example dir for no-unsafe
run: |
cp target/aarch64-pc-windows-msvc/release/libmathcat_c.dll Example/
- name: create zip file for no-unsafe dll
uses: thedoctor0/zip-release@0.7.5
with:
type: 'zip'
filename: '../libmathcat_c.dll-no-unsafe-64-arm.zip'
directory: 'Example'
path: 'libmathcat_c.dll'
- name: Upload 64 bit arm dll files
uses: actions/upload-artifact@v4
with:
name: libmathcat_c.dll-64-arm
path: |
libmathcat_c.dll-64-arm.zip
libmathcat_c.dll-no-unsafe-64-arm.zip
compression-level: 0
retention-days: 1
pre-release:
name: Pre Release
continue-on-error: false
needs: [rules-headers-tests, rust-32-win, rust-64-win, rust-64-arm-win]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download Rules.zip, 2 header files, and 2 test files
uses: actions/download-artifact@v4
with:
name: rules-headers-tests
- name: Download 32 bit builds
uses: actions/download-artifact@v4
with:
name: libmathcat_c.dll-32-win
- name: Download 64 bit builds
uses: actions/download-artifact@v4
with:
name: libmathcat_c.dll-64-win
- name: Download 64 bit arm builds
uses: actions/download-artifact@v4
with:
name: libmathcat_c.dll-64-arm
- name: Automatic release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
prerelease: true
title: Development Build
files: |
libmathcat*.zip
Rules.zip
*.h
test.*