Skip to content

Commit c00ff68

Browse files
committed
Add GitHub Actions workflows for building and managing pull requests
1 parent cbe8935 commit c00ff68

12 files changed

Lines changed: 157 additions & 153 deletions

File tree

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* @OneLiteFeatherNET/gameruletemplate-maintainers
2+
/.github/CODEOWNERS @OneLiteFeatherNET/core-team

.github/release-drafter.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_extends: .github

.github/workflows/build-pr.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build PR
2+
on: [pull_request]
3+
jobs:
4+
build_pr:
5+
if: github.repository_owner == 'OneLiteFeatherNET'
6+
name: Build Pull Request Branch
7+
description: This job builds the pull request branch on different operating systems.
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest, windows-latest, macos-latest]
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v4
15+
- name: Validate Gradle Wrapper
16+
uses: gradle/wrapper-validation-action@v3
17+
- name: Setup Java
18+
uses: actions/setup-java@v4
19+
with:
20+
distribution: temurin
21+
java-version: 21
22+
- name: Build on ${{ matrix.os }}
23+
run: ./gradlew clean build
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Close invalid PRs
2+
3+
on:
4+
pull_request_target:
5+
types: [ opened ]
6+
7+
jobs:
8+
run:
9+
if: ${{ github.repository != github.event.pull_request.head.repo.full_name && github.head_ref == 'main' }}
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: superbrothers/close-pull-request@v3
13+
with:
14+
comment: "Please do not open pull requests from the `main` branch, create a new branch instead."

.github/workflows/main-build.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Main Branch Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'releases/*'
8+
9+
jobs:
10+
build and test:
11+
if: github.repository_owner == 'OneLiteFeatherNET'
12+
name: Build and Test
13+
description: This job builds and tests the project on different operating systems.
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest, windows-latest, macos-latest]
18+
steps:
19+
- name: Checkout Repository
20+
uses: actions/checkout@v4
21+
- name: Validate Gradle Wrapper
22+
uses: gradle/wrapper-validation-action@v3
23+
- name: Setup Java
24+
uses: actions/setup-java@v4
25+
with:
26+
distribution: temurin
27+
java-version: 21
28+
- name: Build on ${{ matrix.os }}
29+
run: ./gradlew test
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: draft release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- main
7+
- develop
8+
pull_request:
9+
types: [opened, reopened, synchronize]
10+
pull_request_target:
11+
types: [opened, reopened, synchronize]
12+
permissions:
13+
contents: read
14+
jobs:
15+
update_release_draft:
16+
permissions:
17+
contents: write
18+
pull-requests: write
19+
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: release-drafter/release-drafter@v6
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tag-build.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Tag Build
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
container:
12+
image: gradle:8.13.0-jdk21
13+
env:
14+
GRADLE_OPTS: "-Dorg.gradle.internal.launcher.welcomeMessageEnabled=false"
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
- name: Cache Gradle packages
19+
uses: actions/cache@v4
20+
with:
21+
path: ~/.gradle/caches
22+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
23+
restore-keys: |
24+
${{ runner.os }}-gradle-
25+
- name: Build
26+
run: gradle build -x test
27+
28+
test:
29+
runs-on: ubuntu-latest
30+
container:
31+
image: gradle:8.13.0-jdk21
32+
env:
33+
GRADLE_OPTS: "-Dorg.gradle.internal.launcher.welcomeMessageEnabled=false"
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v4
37+
- name: Cache Gradle packages
38+
uses: actions/cache@v4
39+
with:
40+
path: ~/.gradle/caches
41+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
42+
restore-keys: |
43+
${{ runner.os }}-gradle-
44+
- name: Test
45+
run: gradle test
46+
47+
publish:
48+
runs-on: ubuntu-latest
49+
container:
50+
image: gradle:8.13.0-jdk21
51+
env:
52+
GRADLE_OPTS: "-Dorg.gradle.internal.launcher.welcomeMessageEnabled=false"
53+
steps:
54+
- name: Checkout code
55+
uses: actions/checkout@v4
56+
- name: Cache Gradle packages
57+
uses: actions/cache@v4
58+
with:
59+
path: ~/.gradle/caches
60+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
61+
restore-keys: |
62+
${{ runner.os }}-gradle-
63+
- name: Publish
64+
run: gradle publish

.gitlab-ci.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

.gitlab/CODEOWNERS

Lines changed: 0 additions & 4 deletions
This file was deleted.

.gitlab/issue_templates/bug.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)