mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2026-11-05 17:42:32 -05:00
35 lines
1.3 KiB
YAML
35 lines
1.3 KiB
YAML
name: Build
|
|
on: [pull_request, push, workflow_dispatch]
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
# Only run on PRs if the source branch is on a different repo. We do not need to run everything twice.
|
|
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 30
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- name: Set up Gradle
|
|
uses: gradle/actions/setup-gradle@f29f5a9d7b09a7c6b29859002d29d24e1674c884 # 5.0.1
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # 5.2.0
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: 17
|
|
check-latest: true
|
|
- name: Build with Gradle
|
|
run: ./gradlew build
|
|
- name: Upload Artifacts to GitHub
|
|
# Only upload on the preview repository as there is no CI job for it.
|
|
if: ${{ github.repository == 'ViaVersion/ViaVersionDev' && github.ref_name == 'preview' }}
|
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # 6.0.0
|
|
with:
|
|
name: Artifacts
|
|
path: build/libs/
|
|
if-no-files-found: error
|