-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
43 additions
and
47 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 |
---|---|---|
@@ -1,49 +1,45 @@ | ||
name: Build cloud-discord | ||
name: Build | ||
on: | ||
push: | ||
branches: [ "**" ] | ||
tags-ignore: [ "**" ] | ||
pull_request: | ||
release: | ||
types: [ released ] | ||
push: | ||
branches: [ "**" ] | ||
tags-ignore: [ "**" ] | ||
pull_request: | ||
release: | ||
types: [ released ] | ||
jobs: | ||
build: | ||
# Only run on PRs if the source branch is on someone else's repo | ||
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: gradle/wrapper-validation-action@v1 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17 | ||
- name: Build | ||
run: ./gradlew build | ||
- name : Test Summary | ||
uses : EnricoMi/[email protected] | ||
with : | ||
junit_files : "**/build/test-results/test/TEST-*.xml" | ||
if : always() | ||
- name: Determine Status | ||
run: | | ||
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then | ||
echo "STATUS=snapshot" >> $GITHUB_ENV | ||
else | ||
echo "STATUS=release" >> $GITHUB_ENV | ||
fi | ||
- name: Publish Snapshot | ||
if: "${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/1.0.0-dev' }}" | ||
run: ./gradlew publish | ||
env: | ||
ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}" | ||
ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SONATYPE_PASSWORD }}" | ||
- name: Publish Release | ||
if: "${{ env.STATUS == 'release' && github.event_name == 'release' }}" | ||
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository | ||
env: | ||
ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}" | ||
ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SONATYPE_PASSWORD }}" | ||
ORG_GRADLE_PROJECT_signingKey: "${{ secrets.SIGNING_KEY }}" | ||
ORG_GRADLE_PROJECT_signingPassword: "${{ secrets.SIGNING_PASSWORD }}" | ||
build: | ||
# Only run on PRs if the source branch is on someone else's repo | ||
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: gradle/wrapper-validation-action@v1 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17 | ||
- uses: gradle/gradle-build-action@v2 | ||
- name: Build | ||
run: ./gradlew build | ||
- name: Determine Status | ||
run: | | ||
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then | ||
echo "STATUS=snapshot" >> $GITHUB_ENV | ||
else | ||
echo "STATUS=release" >> $GITHUB_ENV | ||
fi | ||
#- name: Publish Snapshot | ||
# if: "${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}" | ||
# run: ./gradlew publish | ||
# env: | ||
# ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}" | ||
# ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SONATYPE_PASSWORD }}" | ||
#- name: Publish Release | ||
# if: "${{ env.STATUS == 'release' && github.event_name == 'release' }}" | ||
# run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository | ||
# env: | ||
# ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}" | ||
# ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SONATYPE_PASSWORD }}" | ||
# ORG_GRADLE_PROJECT_signingKey: "${{ secrets.SIGNING_KEY }}" | ||
# ORG_GRADLE_PROJECT_signingPassword: "${{ secrets.SIGNING_PASSWORD }}" |