2.0.3 #6
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: build | |
on: | |
release: | |
types: | |
- created | |
workflow_dispatch: | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
build-linux-x86-64: | |
runs-on: ubuntu-20.04 | |
defaults: | |
run: | |
working-directory: ./rust | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Cargo build | |
run: | | |
cargo build --release --lib | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: lame4j-linux-x86-64 | |
path: ./rust/target/release/liblame4j.so | |
build-linux-x86: | |
runs-on: ubuntu-20.04 | |
defaults: | |
run: | |
working-directory: ./rust | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Update | |
run: sudo apt-get update -y | |
- name: Install libc6-dev-i386 | |
run: sudo apt-get install -y libc6-dev-i386 | |
- name: Install gcc-i686-linux-gnu | |
run: sudo apt-get install gcc-i686-linux-gnu -y | |
- name: Cargo build | |
run: | | |
cargo install cargo-xbuild | |
rustup target add i686-unknown-linux-gnu | |
cargo build --target=i686-unknown-linux-gnu --release --lib | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: lame4j-linux-x86 | |
path: ./rust/target/i686-unknown-linux-gnu/release/liblame4j.so | |
build-linux-aarch64: | |
runs-on: ubuntu-20.04 | |
defaults: | |
run: | |
working-directory: ./rust | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Update | |
run: sudo apt-get update -y | |
- name: Install gcc-aarch64-linux-gnu | |
run: sudo apt-get install gcc-aarch64-linux-gnu -y | |
- name: Cargo build | |
run: | | |
cargo install cargo-xbuild | |
rustup target add aarch64-unknown-linux-gnu | |
cargo build --target=aarch64-unknown-linux-gnu --release --lib | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: lame4j-linux-aarch64 | |
path: ./rust/target/aarch64-unknown-linux-gnu/release/liblame4j.so | |
build-macos-x86-64: | |
runs-on: macos-11 | |
defaults: | |
run: | |
working-directory: ./rust | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download and extract MacOS SDK | |
run: | | |
mkdir -p sdk | |
cd sdk | |
wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.14.sdk.tar.xz | |
tar -xJf MacOSX10.14.sdk.tar.xz | |
- name: Cargo build | |
run: | | |
SDKROOT=$(pwd)/sdk/MacOSX10.14.sdk/ MACOSX_DEPLOYMENT_TARGET=10.14 cargo build --release --lib | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: lame4j-macos-x86-64 | |
path: ./rust/target/release/liblame4j.dylib | |
build-macos-aarch64: | |
runs-on: macos-11 | |
defaults: | |
run: | |
working-directory: ./rust | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download and extract MacOS SDK | |
run: | | |
mkdir -p sdk | |
cd sdk | |
wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.0.sdk.tar.xz | |
tar -xJf MacOSX11.0.sdk.tar.xz | |
- name: Cargo build | |
run: | | |
cargo install cargo-xbuild | |
rustup target add aarch64-apple-darwin | |
MP3LAME_SYS_OVERRIDE_HOST=aarch64-apple-darwin SDKROOT=$(pwd)/sdk/MacOSX11.0.sdk/ MACOSX_DEPLOYMENT_TARGET=11.0 cargo build --target=aarch64-apple-darwin --release --lib | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: lame4j-macos-aarch64 | |
path: ./rust/target/aarch64-apple-darwin/release/liblame4j.dylib | |
build-windows-x86-64: | |
runs-on: windows-2019 | |
defaults: | |
run: | |
working-directory: ./rust | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Cargo build | |
run: | | |
cargo build --release --lib | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: lame4j-windows-x86-64 | |
path: ./rust/target/release/lame4j.dll | |
build-windows-x86: | |
runs-on: windows-2019 | |
defaults: | |
run: | |
working-directory: ./rust | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Cargo build | |
run: | | |
cargo install cargo-xbuild | |
rustup target add i686-pc-windows-msvc | |
cargo build --target=i686-pc-windows-msvc --release --lib | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: lame4j-windows-x86 | |
path: ./rust/target/i686-pc-windows-msvc/release/lame4j.dll | |
build-java-library: | |
runs-on: ubuntu-20.04 | |
needs: [build-linux-x86-64, build-linux-x86, build-linux-aarch64, build-macos-x86-64, build-macos-aarch64, build-windows-x86-64, build-windows-x86] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Java 8 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '8' | |
server-id: henkelmax.public | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
- name: Download linux-x86-64 | |
uses: actions/download-artifact@v3 | |
with: | |
name: lame4j-linux-x86-64 | |
path: ./src/main/resources/natives/linux-x64/ | |
- name: Download linux-x86 | |
uses: actions/download-artifact@v3 | |
with: | |
name: lame4j-linux-x86 | |
path: ./src/main/resources/natives/linux-x86/ | |
- name: Download linux-aarch64 | |
uses: actions/download-artifact@v3 | |
with: | |
name: lame4j-linux-aarch64 | |
path: ./src/main/resources/natives/linux-aarch64/ | |
- name: Download macos-x86-64 | |
uses: actions/download-artifact@v3 | |
with: | |
name: lame4j-macos-x86-64 | |
path: ./src/main/resources/natives/mac-x64/ | |
- name: Download macos-aarch64 | |
uses: actions/download-artifact@v3 | |
with: | |
name: lame4j-macos-aarch64 | |
path: ./src/main/resources/natives/mac-aarch64/ | |
- name: Download windows-x86-64 | |
uses: actions/download-artifact@v3 | |
with: | |
name: lame4j-windows-x86-64 | |
path: ./src/main/resources/natives/windows-x64/ | |
- name: Download windows-x86 | |
uses: actions/download-artifact@v3 | |
with: | |
name: lame4j-windows-x86 | |
path: ./src/main/resources/natives/windows-x86/ | |
- name: Build and deploy | |
run: | | |
mvn -B install | |
mkdir -p release | |
cp $(find ./target -maxdepth 1 -type f -name "*.jar") ./release/ | |
mvn -B deploy | |
env: | |
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: lame4j-java | |
path: ./release/ | |
- name: Upload release asset | |
uses: AButler/[email protected] | |
with: | |
files: ./release/* | |
repo-token: ${{ secrets.GITHUB_TOKEN }} |