Skip to content

Commit

Permalink
Publish with gradle action
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Aug 26, 2023
1 parent 777e86b commit 4fe395a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,41 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Build with Gradle
- name: Build with gradle
run: |
chmod +x gradlew
if [ -z "${{ inputs.target_subproject }}" ]; then
echo "Building all subprojects"
./gradlew build --no-daemon
./gradlew build
else
args=$(echo "${{ inputs.target_subproject }}" | tr ',' '\n' | sed 's/$/:build/' | paste -sd ' ')
echo "Building $args"
./gradlew $args --no-daemon
echo "Building with arguments=$args"
./gradlew $args
fi
env:
BUILD_ID: ${{ github.run_number }}
BUILD_RELEASE: ${{ inputs.release }}

- uses: actions/upload-artifact@v3
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: versions/*/build/libs/

# - name: Publish with gradle
# run: |
# if [ -z "${{ inputs.target_subproject }}" ]; then
# echo "Publishing all subprojects"
# ./gradlew publish
# else
# args=$(echo "${{ inputs.target_subproject }}" | tr ',' '\n' | sed 's/$/:publish/' | paste -sd ' ')
# echo "Publishing with arguments=$args"
# ./gradlew $args
# fi
# env:
# BUILD_RELEASE: ${{ inputs.release }}
# FALLENS_MAVEN_TOKEN: ${{ secrets.FALLENS_MAVEN_TOKEN }}

summary:
runs-on: ubuntu-22.04
needs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ on:
jobs:
build:
uses: ./.github/workflows/build.yml
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:

build:
uses: ./.github/workflows/build.yml
secrets: inherit
with:
target_subproject: ${{ github.event.inputs.target_subproject }}
release: true
Expand Down

0 comments on commit 4fe395a

Please sign in to comment.