release #2
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
| name: Publish Artifacts | |
| 'on': | |
| repository_dispatch: | |
| types: | |
| - release | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| name: Release | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5.0.0 | |
| with: | |
| ref: ${{ github.event.client_payload.tag }} | |
| - name: Setup Java | |
| uses: actions/setup-java@v5.0.0 | |
| with: | |
| java-version: '21' | |
| distribution: adopt | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4.4.2 | |
| - name: Publish | |
| run: ./gradlew publish --no-configuration-cache --info -Psign=true -PreleaseVersion="$RELEASE_VERSION" | |
| -PsigningKey="$SIGNING_KEY" -PsigningPassword="$SIGNING_PASSWORD" | |
| env: | |
| RELEASE_VERSION: ${{ github.event.client_payload.tag }} | |
| SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
| SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME | |
| }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD | |
| }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD | |
| }} | |
| shell: bash | |
| - name: Build release note | |
| run: |- | |
| { | |
| echo "Changelog:" | |
| TAG=$(echo "refs/tags/$RELEASE_VERSION" | sed "s/.*tags\///g") | |
| # Find the line with ### version and get content until next ### or end | |
| awk "/^### $TAG/{flag=1; next} /^### / && flag{flag=0} flag" CHANGELOG.md | sed '/^$/d' | |
| } > NOTE.md | |
| env: | |
| RELEASE_VERSION: ${{ github.event.client_payload.tag }} | |
| shell: bash | |
| - name: Create Release | |
| uses: actions/create-release@v1 | |
| with: | |
| tag_name: ${{ github.event.client_payload.tag }} | |
| release_name: ${{ github.event.client_payload.tag }} | |
| body_path: NOTE.md | |
| draft: 'false' | |
| prerelease: 'false' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |