Skip to content

Workflow file for this run

name: Build and upload nightly
on:
push:
branches:
- '*'
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: apt-get update -y #&& 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: apt-get install -y gcc-aarch64-linux-gnu
- os: ubuntu-20.04
arch: i686
install: 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:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
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: Add nightly suffix to version
run: sed -e '/pluginVersion = .*/s/"$/-nightly.${{ github.sha }}"/' -i buildSrc/src/main/kotlin/Properties.kt
- name: Get version
id: version
run: echo "version=$(grep pluginVersion buildSrc/src/main/kotlin/Properties.kt | awk -F '"' '{print $2}')" >> $GITHUB_OUTPUT
- name: Build paper
run: ../gradlew build
working-directory: ./paper
- name: Upload paper artifact
uses: actions/upload-artifact@v4
with:
name: voicechat-discord-paper-nightly.jar
path: paper/build/libs/voicechat-discord-paper-${{ steps.version.outputs.version }}.jar
- name: Build fabric
run: ../gradlew build
working-directory: ./fabric
- name: Upload fabric artifact
uses: actions/upload-artifact@v4
with:
name: voicechat-discord-fabric-nightly.jar
path: fabric/build/libs/voicechat-discord-fabric-${{ steps.version.outputs.version }}.jar