From 4fe395abd6df27728dd77a132b9ae17311b2611c Mon Sep 17 00:00:00 2001 From: Fallen_Breath Date: Sat, 26 Aug 2023 19:59:40 +0800 Subject: [PATCH] Publish with gradle action --- .github/workflows/build.yml | 25 ++++++++++++++++++++----- .github/workflows/gradle.yml | 1 + .github/workflows/release.yml | 1 + 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93cfa58..29da1d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index ceae381..aa82de2 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -14,3 +14,4 @@ on: jobs: build: uses: ./.github/workflows/build.yml + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d8e92f3..515d0a1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,6 +38,7 @@ jobs: build: uses: ./.github/workflows/build.yml + secrets: inherit with: target_subproject: ${{ github.event.inputs.target_subproject }} release: true