feat: CI
Some checks failed
Build / build (push) Failing after 1s

This commit is contained in:
bridge 2025-03-01 14:11:27 +01:00
parent e1477bb599
commit 3efaba177f
4 changed files with 36 additions and 79 deletions

View file

@ -0,0 +1,29 @@
name: Build
on:
workflow_dispatch:
push:
branches: ['*']
pull_request:
branches: ['*']
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone project
uses: actions/checkout@v4
- name: Install JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
check-latest: true
- name: Setup gradle
uses: gradle/actions/setup-gradle@v4
- name: Run build & publish with Gradle Wrapper
if: gitea.ref == 'refs/heads/master'
run: chmod +x ./gradlew && ./gradlew build publishAllPublicationsToMavenRepository -PnetheriteRepoUsername=${{ secrets.REPOSILITE_USER }} -PnetheriteRepoPassword=${{ secrets.REPOSILITE_PASSWORD }}

View file

@ -1,29 +0,0 @@
# Thanks paper: https://github.com/papermc/paper/blob/master/.github/workflows/close_invalid_prs.yml
name: Close invalid PRs
on:
pull_request_target:
types: [ opened ]
jobs:
run:
name: Close invalid PRs
if: |
github.repository != github.event.pull_request.head.repo.full_name &&
(
github.head_ref == 'master' ||
github.event.pull_request.head.repo.owner.type != 'User'
)
runs-on: ubuntu-latest
steps:
- uses: superbrothers/close-pull-request@v3
id: "master_branch"
if: github.head_ref == 'master'
with:
comment: "Please do not open pull requests from the `master` branch, create a new branch instead."
- uses: superbrothers/close-pull-request@v3
id: "org_account"
if: github.event.pull_request.head.repo.owner.type != 'User' && steps.master_branch.outcome == 'skipped'
with:
comment: "Please do not open pull requests from non-user accounts like organisations. Create a fork on a user account instead."

View file

@ -1,46 +0,0 @@
name: Build
on:
workflow_dispatch:
push:
branches: ['*']
pull_request:
branches: ['*']
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
env:
TYCOONS_REPO_USER: ${{ secrets.EVOKE_REPO_USERNAME }}
TYCOONS_REPO_PASS: ${{ secrets.EVOKE_REPO_PASSWORD }}
steps:
- name: Clone project
uses: actions/checkout@v4
- name: Install JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
check-latest: true
- name: Setup gradle
uses: gradle/actions/setup-gradle@v4
- name: Run build & publish with Gradle Wrapper
if: github.ref == 'refs/heads/master'
run: chmod +x ./gradlew && ./gradlew publishAllPublicationsToMavenRepository
- name: Run build with Gradle Wrapper
if: github.ref != 'refs/heads/master'
run: chmod +x ./gradlew && ./gradlew build
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: '${{ github.ref_name }}: ${{ github.event.head_commit.message }} (${{ github.sha }})'
prerelease: ${{ github.ref != 'refs/heads/master' }}
tag_name: ${{ github.ref_name }}-${{ github.sha }}

View file

@ -48,10 +48,13 @@ publishing {
repositories {
maven {
url = uri("https://maven.evokegames.gg/snapshots")
credentials {
username = System.getenv("TYCOONS_REPO_USER")
password = System.getenv("TYCOONS_REPO_PASS")
url = uri("https://git.netherite.gg/api/packages/Netherite-Public/maven")
credentials(HttpHeaderCredentials) {
name = "Authorization"
value = "token ${project.properties["netherite.git.packages.token"]}"
}
authentication {
header(HttpHeaderAuthentication)
}
}
}