-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: "tagged-release" | ||
|
||
# Controls when the action will run. | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
jobs: | ||
gh_tagged_release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up JDK 16 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '16' | ||
distribution: 'adopt' | ||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b | ||
- name: Cache Gradle packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build with Gradle | ||
env: | ||
CURSEFORGE_DEPOY_TOKEN: ${{ secrets.CURSEFORGE_DEPOY_TOKEN }} | ||
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | ||
IPNEXT_RELEASE: "yes" | ||
run: ./gradlew build curseforge publishModrinth | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: build/libs/*.jar | ||
body_path: changelog.md | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Cleanup Gradle Cache | ||
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. | ||
# Restoring these files from a GitHub Actions cache might cause problems for future builds. | ||
run: | | ||
rm -f ~/.gradle/caches/modules-2/modules-2.lock | ||
rm -f ~/.gradle/caches/modules-2/gc.properties |