forked from yzl210/TeamProjectE
-
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.
- Loading branch information
Ally Mitchell
committed
Jul 9, 2024
1 parent
a98c2be
commit 1f5da4b
Showing
3 changed files
with
80 additions
and
1 deletion.
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,48 @@ | ||
name: Publish with Gradle | ||
|
||
on: | ||
push: | ||
branches: [ '1.20.1' ] | ||
|
||
env: | ||
CACHE_REV: "1" | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
${{ github.workspace}}/build/ | ||
${{ github.workspace}}/.gradle/ | ||
key: "${{ runner.os }}-build-${{ env.CACHE_REV }}-${{ hashFiles('**/*.gradle*') }}" | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.CACHE_REV }}- | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
- name: Validate Gradle Wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: Setup workspace | ||
run: | | ||
echo "GIT_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV | ||
echo "GIT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV | ||
- name: Publish Snapshot | ||
if: ${{ github.ref_name == 'develop' }} | ||
run: | | ||
chmod +x ./gradlew && ./gradlew "-PpistonVersion=${{ steps.calver.outputs.release }}-SNAPSHOT" "-Pmaven.auth.username=${MAVEN_USERNAME}" "-Pmaven.auth.password=${MAVEN_PASSWORD}" publish --stacktrace | ||
- name: Publish Release | ||
if: ${{ github.ref_name == 'production' }} | ||
run: | | ||
chmod +x ./gradlew && ./gradlew "-Pmaven.auth.username=${{ secrets.MAVEN_USERNAME }}" "-Pmaven.auth.password=${{ secrets.MAVEN_PASSWORD }}" publish --stacktrace |
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