Skip to content

Commit

Permalink
ci: Add auto publish action
Browse files Browse the repository at this point in the history
* For auto publish to Modrinth and CurseForge, MODRINTH_TOKEN and CF_API_TOKEN are required
  • Loading branch information
half-nothing committed Sep 11, 2024
1 parent fca0ee4 commit c82c425
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 45 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@ name: build
on: [ push, pull_request ]

jobs:
build:
runs-on: ubuntu-latest
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
steps:
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'liberica'
cache: 'gradle'
- 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: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.8

- name: Build artifacts
run: gradle build
- name: Build artifacts
run: gradle build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: build/libs
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: build/libs
24 changes: 0 additions & 24 deletions .github/workflows/check_style.yml

This file was deleted.

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/[email protected]
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

0 comments on commit c82c425

Please sign in to comment.