Update deps #15
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
release: | |
runs-on: ${{ matrix.os }} | |
env: | |
RUSTFLAGS: "-C target-feature=-crt-static" | |
PKG_CONFIG_ALLOW_CROSS: 1 | |
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc | |
strategy: | |
matrix: | |
include: | |
- build: linux | |
os: ubuntu-22.04 | |
target: x86_64-unknown-linux-gnu | |
- build: linux | |
os: ubuntu-22.04 | |
target: x86_64-unknown-linux-musl | |
- build: linux | |
os: ubuntu-20.04 ## older ubuntu to avoid messing with glibc version | |
target: arm-unknown-linux-gnueabihf | |
- build: macos | |
os: macos-12 | |
target: x86_64-apple-darwin | |
- build: macos | |
os: macos-12 | |
target: aarch64-apple-darwin | |
- build: windows | |
os: windows-2022 | |
target: x86_64-pc-windows-msvc | |
- build: windows | |
os: windows-2022 | |
target: x86_64-pc-windows-gnu | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: install packages (linux) | |
if: matrix.build == 'linux' | |
run: | | |
sudo apt update | |
sudo apt install libsqlite3-dev gcc-arm-linux-gnueabihf musl-tools -qy | |
- name: install packages (macos) | |
if: matrix.build == 'macos' | |
run: | | |
brew install sqlite3 pkg-config | |
- name: install packages (windows) | |
if: matrix.build == 'windows' | |
run: | | |
choco install -y --no-progress --allow-empty-checksums --fail-on-stderr pkgconfiglite | |
$env:PKG_CONFIG_PATH="C:/sqlite3/sqlite-amalgamation-3400100/" | |
$env:SQLITE_URL="https://www.sqlite.org/2022/sqlite-amalgamation-3400100.zip" | |
mkdir C:\sqlite3\ | |
curl $env:SQLITE_URL -o C:\sqlite3\sqlite3.zip | |
Expand-Archive C:\sqlite3\sqlite3.zip -DestinationPath C:\sqlite3\ | |
@" | |
Name: sqlite3 | |
Description: sqlite3 amalgamation | |
Version: 3.40.1 | |
Cflags: -I${env:PKG_CONFIG_PATH} | |
Libs: | |
"@ > $env:PKG_CONFIG_PATH\sqlite3.pc | |
echo "PKG_CONFIG_PATH=$env:PKG_CONFIG_PATH" >> $env:GITHUB_ENV | |
- name: setup rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
- name: build binary | |
run: | | |
cargo build --verbose --release --target ${{ matrix.target }} | |
ls target/${{ matrix.target }}/release/ | |
- name: build archive | |
if: matrix.build == 'linux' | |
run: | | |
export ARTIFACT_NAME=${{ matrix.target }}.tgz | |
tar -czf $ARTIFACT_NAME -C "./target/${{ matrix.target }}/release/" libmycelite.so | |
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV | |
- name: build archive | |
if: matrix.build == 'macos' | |
run: | | |
export ARTIFACT_NAME=${{ matrix.target }}.tgz | |
tar -czf $ARTIFACT_NAME -C "./target/${{ matrix.target }}/release/" libmycelite.dylib | |
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV | |
- name: build archive | |
if: matrix.build == 'windows' | |
run: | | |
$env:ARTIFACT_NAME="${{ matrix.target }}.zip" | |
mv .\target\${{ matrix.target }}\release\mycelite.dll .\target\${{ matrix.target }}\release\libmycelite.dll | |
Compress-Archive -Path .\target\${{ matrix.target }}\release\libmycelite.dll -DestinationPath $env:ARTIFACT_NAME | |
echo "ARTIFACT_NAME=$env:ARTIFACT_NAME" >> $env:GITHUB_ENV | |
- name: release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: ${{ env.ARTIFACT_NAME }} | |
artifactErrorsFailBuild: true | |
allowUpdates: true |