mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 06:28:54 +00:00
Update build.yml
This commit is contained in:
1 parent
04379d19c6
commit
85af9a151e
1 file changed
+43
-5
@@ -1,17 +1,55 @@
|
|||||||
name: Build CarbonChat
|
name: Build
|
||||||
on: [ push, pull_request ]
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "*" ]
|
||||||
|
tags-ignore: [ "*" ]
|
||||||
|
pull_request:
|
||||||
|
release:
|
||||||
|
types: [ released ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
# Only run on PRs if the source branch is on someone else's repo
|
# 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 }}
|
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
java: [ 17 ]
|
||||||
|
fail-fast: true
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: gradle/wrapper-validation-action@v1
|
- uses: gradle/wrapper-validation-action@v1
|
||||||
- name: Set up JDK
|
- name: JDK ${{ matrix.java }}
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
|
java-version: ${{ matrix.java }}
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '17'
|
- 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: Build
|
- name: Build
|
||||||
run: ./gradlew build
|
run: ./gradlew build --stacktrace
|
||||||
|
- name: Determine Release 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/rewrite' }}"
|
||||||
|
run: ./gradlew publish --stacktrace
|
||||||
|
env:
|
||||||
|
ORG_GRADLE_PROJECT_parksUsername: "${{ secrets.CI_USER }}"
|
||||||
|
ORG_GRADLE_PROJECT_parksPassword: "${{ secrets.CI_PASS }}"
|
||||||
|
- name: Publish Release
|
||||||
|
if: "${{ env.STATUS == 'release' && github.event_name == 'release' }}"
|
||||||
|
run: ./gradlew publish --stacktrace
|
||||||
|
env:
|
||||||
|
ORG_GRADLE_PROJECT_parksUsername: "${{ secrets.CI_USER }}"
|
||||||
|
ORG_GRADLE_PROJECT_parksPassword: "${{ secrets.CI_PASS }}"
|
||||||
Reference in new issue
Block a user