Skip to content

Commit d9e5930

Browse files
authored
Merge pull request #3 from AzisabaNetwork/migrate-to-gradle
Migrate to gradle
2 parents 3b6d189 + fa0350a commit d9e5930

File tree

19 files changed

+1335
-94
lines changed

19 files changed

+1335
-94
lines changed

.github/workflows/build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build:
18+
name: Build with Java 8
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 15
21+
22+
steps:
23+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
24+
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
25+
with:
26+
distribution: "adopt"
27+
java-version: 8
28+
29+
- name: Cache .m2 directory
30+
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
31+
with:
32+
path: ~/.m2
33+
key: m2-cache
34+
restore-keys: |
35+
m2-
36+
37+
- name: Setup Gradle
38+
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
39+
40+
- name: Setup BuildTools
41+
run: |
42+
wget "https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar"
43+
java -jar BuildTools.jar --rev 1.14.4
44+
45+
- name: Setup ProtocolLib
46+
run: |
47+
wget -O ./libs/ProtocolLib.jar "https://github.com/dmulloy2/ProtocolLib/releases/download/4.6.0/ProtocolLib.jar"
48+
49+
- name: Build with Gradle
50+
run: ./gradlew build
51+
52+
- name: Upload a Build Artifact
53+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
54+
with:
55+
path: build/libs/
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Plugin version. ex: x.x.x, x.x.x-SNAPSHOT'
8+
required: true
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build-test:
16+
name: Build test for release
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 3
19+
steps:
20+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
21+
- uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
22+
with:
23+
distribution: "adopt"
24+
java-version: 8
25+
26+
- name: Setup Gradle
27+
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
28+
29+
- name: Build
30+
run: ./gradlew build
31+
env:
32+
VERSION: ${{ github.event.inputs.version }}
33+
34+
- name: Upload a Build Artifact
35+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
36+
with:
37+
path: build/libs/
38+
39+
- name: Publish to azisaba repo
40+
run: ./gradlew publish
41+
env:
42+
VERSION: ${{ github.event.inputs.version }}
43+
REPO_USERNAME: ${{ secrets.REPO_USERNAME }}
44+
REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}
45+
46+
- name: Create release
47+
uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1
48+
with:
49+
tag_name: ${{ github.event.inputs.version }}
50+
files: build/libs/*.jar
51+
generate_release_notes: true

.gitignore

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,68 @@ BuildTools.jar
44
BuildTools.*
55
*.imi
66
*.iml
7+
8+
# Created by https://www.toptal.com/developers/gitignore/api/java
9+
# Edit at https://www.toptal.com/developers/gitignore?templates=java
10+
11+
### Java ###
12+
# Compiled class file
13+
*.class
14+
15+
# Log file
16+
*.log
17+
18+
# BlueJ files
19+
*.ctxt
20+
21+
# Mobile Tools for Java (J2ME)
22+
.mtj.tmp/
23+
24+
# Package Files #
25+
*.jar
26+
*.war
27+
*.nar
28+
*.ear
29+
*.zip
30+
*.tar.gz
31+
*.rar
32+
33+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
34+
hs_err_pid*
35+
replay_pid*
36+
37+
# End of https://www.toptal.com/developers/gitignore/api/java
38+
39+
40+
41+
# Created by https://www.toptal.com/developers/gitignore/api/gradle
42+
# Edit at https://www.toptal.com/developers/gitignore?templates=gradle
43+
44+
### Gradle ###
45+
.gradle
46+
**/build/
47+
!src/**/build/
48+
49+
# Ignore Gradle GUI config
50+
gradle-app.setting
51+
52+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
53+
!gradle-wrapper.jar
54+
55+
# Avoid ignore Gradle wrappper properties
56+
!gradle-wrapper.properties
57+
58+
# Cache of project
59+
.gradletasknamecache
60+
61+
# Eclipse Gradle plugin generated files
62+
# Eclipse Core
63+
.project
64+
# JDT-specific (Eclipse Java Development Tools)
65+
.classpath
66+
67+
### Gradle Patch ###
68+
# Java heap dump
69+
*.hprof
70+
71+
# End of https://www.toptal.com/developers/gitignore/api/gradle

.pinact.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/suzuki-shunsuke/pinact/refs/heads/main/json-schema/pinact.json
2+
# pinact - https://github.com/suzuki-shunsuke/pinact
3+
version: 3
4+
# files:
5+
# - pattern: action.yaml
6+
# - pattern: */action.yaml
7+
8+
ignore_actions:
9+
# - name: slsa-framework/slsa-github-generator/\.github/workflows/generator_generic_slsa3\.yml
10+
# ref: v\d+\.\d+\.\d+
11+
# - name: actions/.*
12+
# ref: main
13+
# - name: suzuki-shunsuke/.*
14+
# ref: release-.*

0 commit comments

Comments
 (0)