-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github testing&publishing actions
- Loading branch information
1 parent
a3e8511
commit 6556bea
Showing
5 changed files
with
134 additions
and
2 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,38 @@ | ||
|
||
name: Build and test | ||
|
||
on: | ||
pull_request: | ||
branches: [ master, main ] | ||
push: | ||
branches: [ master, main ] | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK 8 and 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: | | ||
8 | ||
17 | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build the Gradle plugin | ||
run: ./gradlew --info --stacktrace retrofuturagradle:shadowJar | ||
|
||
- name: Build and locally install the javac plugin | ||
run: ./gradlew --info --stacktrace retrofuturagradle:rfgJavacPlugin:publishToMavenLocal | ||
|
||
- name: Build the test mods | ||
run: ./gradlew --info --stacktrace testmod:build testdepmod:build |
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,70 @@ | ||
|
||
name: Release tagged build | ||
|
||
on: | ||
push: | ||
tags: [ '*' ] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout mod repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set release version | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- name: Set up JDK 8 and 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: | | ||
8 | ||
17 | ||
distribution: 'temurin' | ||
cache: gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build the Gradle plugin | ||
run: ./gradlew --info --stacktrace retrofuturagradle:shadowJar | ||
|
||
- name: Build the javac plugin | ||
run: ./gradlew --info --stacktrace retrofuturagradle:rfgJavacPlugin:shadowJar | ||
|
||
# Continue on error in the following steps to make sure releases still get made even if one of the methods fails | ||
|
||
- name: Delete old release if it already exists | ||
run: gh release delete --yes "${RELEASE_VERSION}" | ||
continue-on-error: true | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Release under current tag | ||
run: | | ||
export "CHANGELOG_FILE=$(mktemp --suffix=.md)" | ||
echo "CHANGELOG_FILE=${CHANGELOG_FILE}" >> $GITHUB_ENV | ||
gh api --method POST -H "Accept: application/vnd.github+json" \ | ||
"/repos/${GITHUB_REPOSITORY}/releases/generate-notes" \ | ||
-f tag_name="${RELEASE_VERSION}" \ | ||
--jq ".body" > "${CHANGELOG_FILE}" | ||
cat "${CHANGELOG_FILE}" | ||
gh release create "${RELEASE_VERSION}" -F "${CHANGELOG_FILE}" ./plugin/build/libs/*.jar ./plugin/rfgJavacPlugin/build/libs/*.jar | ||
shell: bash | ||
continue-on-error: true | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish to Maven | ||
run: ./gradlew --info --stacktrace retrofuturagradle:publish retrofuturagradle:rfgJavacPlugin:publish | ||
continue-on-error: true | ||
env: | ||
MAVEN_USER: ${{ secrets.MAVEN_USER }} | ||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | ||
if: ${{ env.MAVEN_USER != '' }} |
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
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
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