.github/workflows/publish.yml #4
This file contains hidden or 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
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'release version' | |
| required: true | |
| default: '0.0.0-SNAPSHOT' | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| env: | |
| GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dfile.encoding=UTF-8' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ inputs.version}} | |
| - uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Cache Gradle | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| - name: Run Build | |
| env: | |
| ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} | |
| ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} | |
| ORG_GRADLE_PROJECT_version: ${{ github.event.inputs.version }} | |
| run: | | |
| echo "publish as ${{ github.event.inputs.version }}" | |
| ./gradlew build :jig-core:publishToSonatype :jig-gradle-plugin:publishPlugins closeAndReleaseSonatypeStagingRepository | |
| echo ./gradlew build :jig-core:publishToSonatype :jig-gradle-plugin:publishPlugins closeAndReleaseSonatypeStagingRepository | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: jig-cli/build/libs/jig-cli.jar | |
| - name: Upload test failure report | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: test-failure-reports-${{ runner.os }} | |
| path: jig-*/build/reports/tests/test/ | |
| retention-days: 3 |