Skip to content

Thêm GitHub Actions #14

Thêm GitHub Actions

Thêm GitHub Actions #14

Workflow file for this run

name: Build
on:
workflow_dispatch:
pull_request:
push:
jobs:
build:
if: (github.event_name == 'pull_request' && github.event.action == 'labeled') || github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
- uses: actions/[email protected]
with:
distribution: temurin
java-version: 17
cache: "gradle"
- name: Get MineVNLib latest commit sha
uses: nmbgeek/github-action-get-latest-commit@main
with:
owner: minhh2792
repo: minevn-library
branch: master
id: minevnlib-repo
- name: Get MineVNLib version
run: |
git clone https://github.com/minhh2792/minevn-library
cd minevn-library
echo "::set-output name=version::$(awk '/version =/ {gsub("\"", "", $NF); print $NF}' build.gradle.kts | sed 's/[[:space:]]//g')"
id: minevnlib-plugin
- name: Build DotMan & download MineVNLib
run: |
chmod +x ./gradlew
./gradlew assemble
mkdir -p target
cp ./dotman-plugin/build/libs/DotMan.jar ./target/DotMan.jar
wget -O ./target/MineVNLib.jar "https://github.com/minhh2792/minevn-library/releases/download/${{ steps.minevnlib-plugin.outputs.version }}-${{ steps.minevnlib-repo.outputs.shorthash }}/MineVNLib.jar"
- name: Upload build artifact
uses: actions/[email protected]
with:
name: "DotMan"
path: ./target/