Skip to content

Commit

Permalink
ci: Add github action for auto online test and code style check
Browse files Browse the repository at this point in the history
  • Loading branch information
half-nothing committed Sep 12, 2024
1 parent ad5dcb0 commit e1094ae
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: build
on: [ push, pull_request ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'liberica'
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.8

- name: Build artifacts
run: gradle build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: build/libs
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release

on:
release:
types: [ published ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'liberica'
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.8

- name: Build artifacts
run: gradle build

- name: Upload assets to GitHub, Modrinth and CurseForge
uses: Kir-Antipov/mc-publish@v3.3
with:
modrinth-id: QuPbmyCQ
modrinth-featured: false
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

curseforge-id: 945501
curseforge-token: ${{ secrets.CF_API_TOKEN }}

github-token: ${{ secrets.GITHUB_TOKEN }}

loaders: |
fabric
files: |
build/libs/!(*-@(dev-all|sources)).jar
build/libs/*-@(dev-all|sources).jar
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"environment": "server",
"entrypoints": {
"main": [
"TpaPlusPlus"
"net.superricky.tpaplusplus.TpaPlusPlus"
]
},
"depends": {
Expand Down

0 comments on commit e1094ae

Please sign in to comment.