make actions publish manual

This commit is contained in:
creeper123123321 2022-05-22 14:17:14 -03:00
parent 45f1400328
commit 710bae8ff5
3 changed files with 27 additions and 11 deletions

View File

@ -23,10 +23,7 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-gradle- ${{ runner.os }}-gradle-
- name: build - name: build
env: run: ./gradlew build
CURSEFORGE_API_KEY: ${{ secrets.CREEPER_CF }}
MODRINTH_TOKEN: $${ secrets.MODRINTH_TOKEN }
run: ./gradlew
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: Artifacts name: Artifacts

25
.github/workflows/publish.yml vendored Normal file
View File

@ -0,0 +1,25 @@
# Automatically build the project and run any configured tests for every push
# and submitted pull request. This can help catch issues that only occur on
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.
name: publish
on: [workflow_dispatch] # Manual trigger
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 17
- name: build and publish
env:
CURSEFORGE_API_KEY: ${{ secrets.CREEPER_CF }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
run: ./gradlew curseforge modrinth
- uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/

View File

@ -222,10 +222,4 @@ modrinth {
} }
} }
if (getBranch() == "main" defaultTasks("clean", "build")
&& ENV.CURSEFORGE_API_KEY && !ENV.CURSEFORGE_API_KEY.isEmpty()
&& ENV.MODRINTH_TOKEN && !ENV.MODRINTH_TOKEN.isEmpty()) {
defaultTasks("clean", "build", "curseforge", "modrinth")
} else {
defaultTasks("clean", "build")
}