fix actions chạy 2 lần: push và pr sync #10
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 | |
on: | |
push: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- labeled | |
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 | |
- 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.outputs.shorthash }}/MineVNLib.jar" | |
- name: Upload build artifact | |
uses: actions/[email protected] | |
with: | |
name: "DotMan" | |
path: ./target/ |