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 and publish stable release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
natives: | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, macos-latest, windows-latest] | |
arch: [aarch64, x86_64, i686] | |
exclude: | |
- os: macos-latest | |
arch: i686 | |
- os: windows-latest | |
arch: aarch64 | |
- os: windows-latest | |
arch: i686 | |
include: | |
- os: ubuntu-20.04 | |
triple: unknown-linux-gnu | |
filename: libvoicechat_discord.so | |
pre-install: sudo apt-get update -y #&& sudo apt-get install -y curl | |
#container: debian:buster | |
- os: macos-latest | |
triple: apple-darwin | |
filename: libvoicechat_discord.dylib | |
- os: windows-latest | |
triple: pc-windows-gnu | |
filename: voicechat_discord.dll | |
- os: ubuntu-20.04 | |
arch: aarch64 | |
install: sudo apt-get install -y gcc-aarch64-linux-gnu | |
- os: ubuntu-20.04 | |
arch: i686 | |
install: sudo apt-get install -y gcc-i686-linux-gnu | |
runs-on: ${{ matrix.os }} | |
#container: | |
# image: ${{ matrix.container }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Pre-package installation | |
if: ${{ matrix.pre-install }} | |
run: ${{ matrix.pre-install }} | |
- name: Install packages | |
if: ${{ matrix.install }} | |
run: ${{ matrix.install }} | |
- name: Setup Xcode | |
uses: maxim-lobanov/setup-xcode@v1 | |
if: ${{ contains(matrix.os, 'macos') }} | |
with: | |
xcode-version: latest-stable | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.arch }}-${{ matrix.triple }} | |
- name: Build ${{ matrix.arch }}-${{ matrix.triple }} | |
run: cargo build --target ${{ matrix.arch }}-${{ matrix.triple }} --release | |
working-directory: core | |
- name: Upload ${{ matrix.filename }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: natives-${{ matrix.arch }}-${{ matrix.triple }} | |
path: core/target/${{ matrix.arch }}-${{ matrix.triple }}/release/${{ matrix.filename }} | |
if-no-files-found: error | |
build: | |
strategy: | |
matrix: | |
java: [21] | |
os: [ubuntu-20.04] | |
runs-on: ${{ matrix.os }} | |
needs: [natives] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download linux-aarch64 | |
uses: actions/download-artifact@v4 | |
with: | |
name: natives-aarch64-unknown-linux-gnu | |
path: core/src/main/resources/natives/linux-aarch64/ | |
- name: Download linux-x64 | |
uses: actions/download-artifact@v4 | |
with: | |
name: natives-x86_64-unknown-linux-gnu | |
path: core/src/main/resources/natives/linux-x64/ | |
- name: Download linux-x86 | |
uses: actions/download-artifact@v4 | |
with: | |
name: natives-i686-unknown-linux-gnu | |
path: core/src/main/resources/natives/linux-x86/ | |
- name: Download mac-aarch64 | |
uses: actions/download-artifact@v4 | |
with: | |
name: natives-aarch64-apple-darwin | |
path: core/src/main/resources/natives/mac-aarch64/ | |
- name: Download mac-x64 | |
uses: actions/download-artifact@v4 | |
with: | |
name: natives-x86_64-apple-darwin | |
path: core/src/main/resources/natives/mac-x64/ | |
- name: Download windows-x64 | |
uses: actions/download-artifact@v4 | |
with: | |
name: natives-x86_64-pc-windows-gnu | |
path: core/src/main/resources/natives/windows-x64/ | |
- name: Validate gradle wrapper | |
uses: gradle/actions/wrapper-validation@v3 | |
- name: Setup JDK ${{ matrix.java }} | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: adopt | |
- name: Make gradle wrapper executable | |
run: chmod +x ./gradlew | |
- name: Build and publish to modrinth | |
run: ./gradlew publish | |
env: | |
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} |