chore(release): Bump version to 0.2.2 #5
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Publish to Maven Central | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'TJC-LP/scalagent' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up JDK | |
| uses: coursier/setup-action@v1 | |
| with: | |
| jvm: temurin:25 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install npm dependencies | |
| run: bun install | |
| - name: Cache Coursier | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/coursier | |
| ~/.ivy2/cache | |
| key: ${{ runner.os }}-coursier-${{ hashFiles('build.mill') }} | |
| restore-keys: | | |
| ${{ runner.os }}-coursier- | |
| - name: Cache Mill | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.mill | |
| key: ${{ runner.os }}-mill-${{ hashFiles('build.mill') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mill- | |
| - name: Extract and validate version | |
| id: version | |
| run: | | |
| TAG_VERSION="${GITHUB_REF#refs/tags/v}" | |
| echo "Publishing version: $TAG_VERSION" | |
| if ! [[ "$TAG_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$ ]]; then | |
| echo "Error: Tag must be a valid semver version (e.g., v0.1.0, v1.0.0-RC1)" | |
| exit 1 | |
| fi | |
| echo "version=$TAG_VERSION" >> $GITHUB_OUTPUT | |
| # Extract annotated tag message for release notes | |
| TAG_MESSAGE=$(git tag -l --format='%(contents)' "v$TAG_VERSION" 2>/dev/null || echo "") | |
| if [ -n "$TAG_MESSAGE" ]; then | |
| { | |
| echo 'body<<EOF' | |
| echo "$TAG_MESSAGE" | |
| echo 'EOF' | |
| } >> $GITHUB_OUTPUT | |
| echo "has_notes=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "has_notes=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Run Tests | |
| run: ./mill agent.test | |
| - name: Verify Publishing Setup | |
| run: | | |
| echo "Version: $PUBLISH_VERSION" | |
| ./mill show agent.publishVersion | |
| ./mill show agent.pomSettings | |
| env: | |
| PUBLISH_VERSION: ${{ steps.version.outputs.version }} | |
| - name: Publish to Maven Central | |
| run: ./mill -i mill.scalalib.SonatypeCentralPublishModule/ | |
| env: | |
| PUBLISH_VERSION: ${{ steps.version.outputs.version }} | |
| MILL_SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| MILL_SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
| MILL_PGP_SECRET_BASE64: ${{ secrets.PGP_SECRET }} | |
| MILL_PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| body: ${{ steps.version.outputs.body }} | |
| generate_release_notes: ${{ steps.version.outputs.has_notes != 'true' }} | |
| draft: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |