upgrade plugin #32
Workflow file for this run
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: Deploy to central | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to publish (e.g., 1.0.0 or 1.0.0-SNAPSHOT)' | |
| required: false | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| test: | |
| uses: ./.github/workflows/ci-build.yml | |
| publish: | |
| needs: test | |
| runs-on: macos-latest | |
| environment: Publish | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| gradle-home-cache-cleanup: true | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Extract version from tag | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| TAG_VERSION=${GITHUB_REF#refs/tags/v} | |
| echo "VERSION=$TAG_VERSION" >> $GITHUB_ENV | |
| echo "Publishing version: $TAG_VERSION" | |
| - name: Use manual version | |
| if: github.event.inputs.version != '' | |
| run: | | |
| echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV | |
| echo "Publishing version: ${{ github.event.inputs.version }}" | |
| - name: Set version in gradle.properties | |
| if: env.VERSION != '' | |
| run: | | |
| echo "library.version=$VERSION" >> gradle.properties | |
| cat gradle.properties | grep library.version | |
| - name: Assemble libraries | |
| run: ./gradlew :ComposeTextEditor:assemble :ComposeTextEditorSpellCheck:assemble --no-daemon --stacktrace | |
| - name: Publish to Maven Central | |
| env: | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} | |
| run: | | |
| ./gradlew :ComposeTextEditor:publishAllPublicationsToMavenCentralRepository --no-daemon --stacktrace | |
| ./gradlew :ComposeTextEditorSpellCheck:publishAllPublicationsToMavenCentralRepository --no-daemon --stacktrace | |
| - name: Create GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| draft: false | |
| prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish Summary | |
| if: success() | |
| run: | | |
| echo "## :rocket: Published Successfully" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Group ID:** com.darkrockstudios" >> $GITHUB_STEP_SUMMARY | |
| echo "**Artifacts:**" >> $GITHUB_STEP_SUMMARY | |
| echo "- composetexteditor" >> $GITHUB_STEP_SUMMARY | |
| echo "- composetexteditorspellcheck" >> $GITHUB_STEP_SUMMARY | |
| echo "**Version:** $VERSION" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Next Steps" >> $GITHUB_STEP_SUMMARY | |
| if [[ "$VERSION" == *"-SNAPSHOT" ]]; then | |
| echo "- Snapshot published to Maven Central snapshots repository" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "- Published to Maven Central Portal (https://central.sonatype.com/)" >> $GITHUB_STEP_SUMMARY | |
| echo "- Wait 10-30 minutes for sync to Maven Central" >> $GITHUB_STEP_SUMMARY | |
| echo "- Verify on [Maven Central Search](https://search.maven.org/search?q=g:com.darkrockstudios)" >> $GITHUB_STEP_SUMMARY | |
| fi |