mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-29 11:59:17 +00:00
53 lines
1.8 KiB
YAML
53 lines
1.8 KiB
YAML
# This workflow uses actions that are not certified by GitHub.
|
|
# They are provided by a third-party and are governed by
|
|
# separate terms of service, privacy policy, and support
|
|
# documentation.
|
|
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
|
|
|
name: Leaves CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'adopt'
|
|
- name: Setup Git Config
|
|
run: |
|
|
git config --global user.email "ci@leavesmc.top"
|
|
git config --global user.name "Leaves CI"
|
|
- name: Apply Patches
|
|
uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7
|
|
with:
|
|
arguments: applyPatches
|
|
- name: Paperclip Jar
|
|
uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7
|
|
with:
|
|
arguments: createReobfPaperclipJar
|
|
- name: Rename Jar And Set env
|
|
run: |
|
|
mv build/libs/Leaves-paperclip-1.19.1-R0.1-SNAPSHOT-reobf.jar leaves-1.19.1.jar
|
|
echo "message=`git log --pretty=format:“%s” -1`" >> $GITHUB_ENV
|
|
echo "name=Leaves-`git rev-parse --short HEAD`" >> $GITHUB_ENV
|
|
echo "tag=1.19.1-`git rev-parse --short HEAD`" >> $GITHUB_ENV
|
|
- name: Create Release
|
|
uses: ncipollo/release-action@v1
|
|
with:
|
|
artifacts: leaves-1.19.1.jar
|
|
body: ${{ env.message }}
|
|
tag: ${{ env.tag }}
|
|
prerelease: false
|
|
name: ${{ env.name }}
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|