snapshot-jar-only #364
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: snapshot-jar-only | |
| # This workflow is triggered on demand only. Publish the snapshot version of the library and trigger the API workflow. | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| snapshot: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Slack event | |
| if: always() # Pick up events even if the job fails or is canceled. | |
| uses: 8398a7/action-slack@v3 | |
| with: | |
| status: ${{ job.status }} | |
| fields: repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest # selectable (default: repo,message) | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_STARLAKE_CORE_WEBHOOK_URL }} # required | |
| - name: Env | |
| run: | | |
| echo "SONATYPE_USERNAME=${{ secrets.SONATYPE_USERNAME }}" >> $GITHUB_ENV | |
| echo "SONATYPE_PASSWORD=${{ secrets.SONATYPE_PASSWORD }}" >> $GITHUB_ENV | |
| - uses: smartsquaregmbh/delete-old-packages@v0.3.1 | |
| with: | |
| version-pattern: "^\\d+\\.\\d+\\.\\d+-SNAPSHOT$" # Remove all previous SNAPSHOT versions | |
| keep: 0 | |
| names: | | |
| ai.starlake.starlake-core_2.13 | |
| - uses: actions/checkout@v4 | |
| - name: Set up Zulu 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' # See 'Supported distributions' for available options | |
| java-version: '17' | |
| - name: Setup sbt launcher | |
| uses: sbt/setup-sbt@v1 | |
| with: | |
| sbt-runner-version: '1.11.5' | |
| - name: Publish Snapshot on Sonatype | |
| env: | |
| SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
| SBT_OPTS: "-Xss8M -Xmx16g -XX:+UseG1GC" | |
| run: sbt update clean compile publish | |
| - name: trigger-starlake-api | |
| if: ${{ success() }} | |
| uses: actions/github-script@v6 | |
| with: | |
| github-token: ${{ secrets.STARLAKE_API_TOKEN }} | |
| script: | | |
| await github.rest.actions.createWorkflowDispatch({ | |
| owner: 'starlake-ai', | |
| repo: 'starlake-api', | |
| workflow_id: 'snapshot-jar-only.yml', | |
| ref: 'main'}) |