forked from SpongePowered/MixinGradle
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change publish location Signed-off-by: C0D3 M4513R <[email protected]> Add publishing Signed-off-by: C0D3 M4513R <[email protected]>
- Loading branch information
1 parent
01de747
commit 0ea7142
Showing
2 changed files
with
106 additions
and
27 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,91 @@ | ||
name: Server builds | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
tags: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- '**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Java 8 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '8' | ||
distribution: 'temurin' | ||
- name: Cache .gradle | ||
uses: burrunan/gradle-cache-action@v1 | ||
with: | ||
# Enable concurrent cache save and restore | ||
# Default is concurrent=false for better log readability | ||
concurrent: true | ||
# Disable caching of $HOME/.gradle/caches/*.*/generated-gradle-jars | ||
save-generated-gradle-jars: false | ||
# Disable publishing Gradle Build Scan URL to job report #Don't | ||
gradle-build-scan-report: true | ||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
- name: Build | ||
run: ./gradlew build | ||
|
||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
if: github.ref_type == 'tag' | ||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Download Build Artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: jar | ||
path: tmp | ||
|
||
- name: Download Hash | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: hash | ||
path: tmp | ||
- name: Get Version Name | ||
id: version_name | ||
run: | | ||
echo version=${GITHUB_REF#refs/tags/v} >> $GITHUB_OUTPUT | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '8' | ||
distribution: 'temurin' | ||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: Build with Gradle | ||
uses: gradle/[email protected] | ||
with: | ||
arguments: publish | ||
env: | ||
KETTINGUSERNAME: ${{ secrets.KETTINGUSERNAME }} | ||
KETTINGPASSWORD: ${{ secrets.KETTINGPASSWORD }} | ||
VERSION: ${{ steps.version_name.outputs.version }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create Release | ||
run: | | ||
gh release create "v$VERSION" build/libs/mixingradle-$VERSION.jar build/libs/mixingradle-$VERSION-groovydoc.jar \ | ||
--repo="$GITHUB_REPOSITORY" \ | ||
--title="${GITHUB_REPOSITORY#*/} v$VERSION" \ | ||
--generate-notes | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VERSION: ${{ steps.version_name.outputs.version }} |
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