Micronaut Starter 4.4.2 #214
Workflow file for this run
This file contains 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: | |
release: | |
types: [published] | |
jobs: | |
build: | |
name: Release artifacts to Maven Central & SDKMAN!, and publish documentation | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- uses: gradle/wrapper-validation-action@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Set the current release version | |
id: release_version | |
run: echo "release_version=${GITHUB_REF:11}" >> $GITHUB_OUTPUT | |
- name: Run pre-release | |
uses: micronaut-projects/github-actions/pre-release@master | |
env: | |
MICRONAUT_BUILD_EMAIL: ${{ secrets.MICRONAUT_BUILD_EMAIL }} | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: projectVersion is not a snapshot | |
run: ./gradlew projectVersionNotSnapshot | |
- name: Micronaut Core is not a snapshot | |
run: ./gradlew micronautCoreNotSnapshot | |
- name: Micronaut Platform is not a snapshot | |
run: ./gradlew micronautPlatformNotSnapshot | |
- name: Build All | |
run: ./gradlew micronaut-cli:assemble | |
env: | |
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | |
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }} | |
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} | |
- name: Publish to Maven Central | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | |
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} | |
GPG_FILE: ${{ secrets.GPG_FILE }} | |
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | |
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }} | |
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} | |
run: echo $GPG_FILE | base64 -d > secring.gpg && ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository docs | |
- name: Upload CLI Zip | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: starter-cli/build/distributions/micronaut-cli-${{ steps.release_version.outputs.release_version }}.zip | |
asset_name: micronaut-cli-${{ steps.release_version.outputs.release_version }}.zip | |
asset_content_type: application/zip | |
- name: Publish to Github Pages | |
if: success() | |
uses: micronaut-projects/github-pages-deploy-action@master | |
env: | |
BETA: ${{ contains(steps.release_version.outputs.release_version, 'M') || contains(steps.release_version.outputs.release_version, 'RC') }} | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
BASE_BRANCH: master | |
BRANCH: gh-pages | |
FOLDER: build/docs | |
VERSION: ${{ steps.release_version.outputs.release_version }} | |
- name: Run post-release | |
if: success() | |
id: post_release | |
continue-on-error: true | |
uses: micronaut-projects/github-actions/post-release@master | |
env: | |
MICRONAUT_BUILD_EMAIL: ${{ secrets.MICRONAUT_BUILD_EMAIL }} | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Back to Micronaut snapshot | |
continue-on-error: true | |
run: | | |
echo "Setting new Micronaut snapshot version" | |
sed -i "s/^micronautVersion.*$/micronautVersion\=${{ steps.post_release.outputs.next_version }}-SNAPSHOT/" gradle.properties | |
- uses: stefanzweifel/git-auto-commit-action@v5.0.1 | |
continue-on-error: true | |
with: | |
commit_message: Back Micronaut version to snapshot | |
commit_user_name: micronaut-build | |
commit_user_email: ${{ secrets.MICRONAUT_BUILD_EMAIL }} | |
commit_author: micronaut-build <${{ secrets.MICRONAUT_BUILD_EMAIL }}> | |
file_pattern: gradle.properties | |
linux: | |
name: Release Linux Native CLI | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Set the current release version | |
id: release_version | |
run: | | |
release_version=${GITHUB_REF:11} | |
sed -i "s/^projectVersion.*$/projectVersion\=${release_version}/" gradle.properties | |
echo "release_version=${release_version}" >> $GITHUB_OUTPUT | |
- name: "☕️ Setup GraalVM CE" | |
uses: graalvm/setup-graalvm@v1.1.9 | |
with: | |
java-version: '17' | |
distribution: 'graalvm-community' | |
native-image-musl: 'true' | |
components: 'native-image' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: "📸 Build the Native Image (with libc=musl)" | |
run: ./gradlew micronaut-cli:nativeCompile --no-daemon -Pmusl | |
env: | |
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | |
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }} | |
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} | |
- name: "✅ Verify Build" | |
run: ./starter-cli/build/native/nativeCompile/mn --version | |
- name: "✅ Verify Create App" | |
run: ./starter-cli/build/native/nativeCompile/mn create-app test | |
- name: "👷♀️Package Build" | |
env: | |
VERSION: ${{ github.event.release.tag_name }} | |
run: | | |
mkdir -p "mn-linux-amd64-${VERSION}/bin" | |
mv ./starter-cli/build/native/nativeCompile/mn "mn-linux-amd64-${VERSION}/bin" | |
cp ./LICENSE "mn-linux-amd64-${VERSION}/" | |
zip -r "mn-linux-amd64-${VERSION}.zip" "mn-linux-amd64-${VERSION}/" | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./mn-linux-amd64-${{ github.event.release.tag_name }}.zip | |
asset_name: mn-linux-amd64-${{ github.event.release.tag_name }}.zip | |
asset_content_type: application/zip | |
macos: | |
name: Release OS X Intel Native CLI | |
runs-on: macos-13 | |
needs: [build] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Set the current release version | |
id: release_version | |
run: | | |
release_version=${GITHUB_REF:11} | |
sed -i -e "s/^projectVersion.*$/projectVersion\=${release_version}/" gradle.properties | |
echo "release_version=${release_version}" >> $GITHUB_OUTPUT | |
- name: "☕️ Setup GraalVM CE" | |
uses: graalvm/setup-graalvm@v1.1.9 | |
with: | |
java-version: '17' | |
distribution: 'graalvm-community' | |
components: 'native-image' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: "📸 Build the Native Image" | |
run: ./gradlew micronaut-cli:nativeCompile --no-daemon | |
env: | |
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | |
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }} | |
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} | |
- name: "✅ Verify Build" | |
run: ./starter-cli/build/native/nativeCompile/mn --version | |
- name: "✅ Verify Create App" | |
run: ./starter-cli/build/native/nativeCompile/mn create-app test | |
- name: Package Build | |
env: | |
VERSION: ${{ github.event.release.tag_name }} | |
run: | | |
mkdir -p "mn-darwin-amd64-${VERSION}/bin" | |
mv ./starter-cli/build/native/nativeCompile/mn "mn-darwin-amd64-${VERSION}/bin" | |
cp ./LICENSE "mn-darwin-amd64-${VERSION}/" | |
zip -r "mn-darwin-amd64-${VERSION}.zip" "mn-darwin-amd64-${VERSION}/" -x '*.DS_Store*' -x '__MAC_OSX' | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./mn-darwin-amd64-${{ github.event.release.tag_name }}.zip | |
asset_name: mn-darwin-amd64-${{ github.event.release.tag_name }}.zip | |
asset_content_type: application/zip | |
macos-arm: | |
name: Release OS X Arm Native CLI | |
runs-on: macos-latest | |
needs: [build] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Set the current release version | |
id: release_version | |
run: | | |
release_version=${GITHUB_REF:11} | |
sed -i -e "s/^projectVersion.*$/projectVersion\=${release_version}/" gradle.properties | |
echo "release_version=${release_version}" >> $GITHUB_OUTPUT | |
- name: "☕️ Setup GraalVM CE" | |
uses: graalvm/setup-graalvm@v1.1.9 | |
with: | |
java-version: '17' | |
distribution: 'graalvm-community' | |
components: 'native-image' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: "📸 Build the Native Image" | |
run: ./gradlew micronaut-cli:nativeCompile --no-daemon | |
env: | |
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | |
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }} | |
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} | |
- name: "✅ Verify Build" | |
run: ./starter-cli/build/native/nativeCompile/mn --version | |
- name: "✅ Verify Create App" | |
run: ./starter-cli/build/native/nativeCompile/mn create-app test | |
- name: Package Build | |
env: | |
VERSION: ${{ github.event.release.tag_name }} | |
run: | | |
mkdir -p "mn-darwin-aarch64-${VERSION}/bin" | |
mv ./starter-cli/build/native/nativeCompile/mn "mn-darwin-aarch64-${VERSION}/bin" | |
cp ./LICENSE "mn-darwin-aarch64-${VERSION}/" | |
zip -r "mn-darwin-aarch64-${VERSION}.zip" "mn-darwin-aarch64-${VERSION}/" -x '*.DS_Store*' -x '__MAC_OSX' | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./mn-darwin-aarch64-${{ github.event.release.tag_name }}.zip | |
asset_name: mn-darwin-aarch64-${{ github.event.release.tag_name }}.zip | |
asset_content_type: application/zip | |
windows: | |
name: Release Windows Native CLI | |
runs-on: windows-latest | |
needs: [build] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: "☕️ Setup GraalVM CE" | |
uses: graalvm/setup-graalvm@v1.1.9 | |
with: | |
java-version: '17' | |
distribution: 'graalvm-community' | |
components: 'native-image' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: "📸 Build the Native Image" | |
run: ./gradlew micronaut-cli:nativeCompile --no-daemon | |
env: | |
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | |
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }} | |
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} | |
- name: "✅ Verify Build (Powershell)" | |
shell: powershell | |
run: ./starter-cli/build/native/nativeCompile/mn.exe --version | |
- name: "✅ Verify Create App (Powershell)" | |
run: ./starter-cli/build/native/nativeCompile/mn.exe create-app test | |
- name: "✅ Verify Build (CMD)" | |
shell: cmd | |
run: starter-cli\\build\\native\\nativeCompile\\mn --version | |
- name: "✅ Verify Create App (CMD)" | |
shell: cmd | |
run: starter-cli\\build\\native\\nativeCompile\\mn create-app test2 | |
- name: "🤐 ZIP Archive" | |
run: | | |
New-Item ./mn-win-amd64-${{ github.event.release.tag_name }}/bin -ItemType Directory -ea 0 | |
Move-Item -Path ./starter-cli/build/native/nativeCompile/mn.exe -Destination ./mn-win-amd64-${{ github.event.release.tag_name }}/bin | |
Copy-Item ./LICENSE -Destination ./mn-win-amd64-${{ github.event.release.tag_name }} | |
Compress-Archive -Path ./mn-win-amd64-${{ github.event.release.tag_name }} -Update -DestinationPath ./mn-win-amd64-${{ github.event.release.tag_name }}.zip | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./mn-win-amd64-${{ github.event.release.tag_name }}.zip | |
asset_name: mn-win-amd64-${{ github.event.release.tag_name }}.zip | |
asset_content_type: application/zip | |
sdkman: | |
name: Release to SDKMAN! | |
runs-on: ubuntu-latest | |
needs: [linux, macos, macos-arm, windows] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Set the current release version | |
id: release_version | |
run: | | |
release_version=${GITHUB_REF:11} | |
sed -i "s/^projectVersion.*$/projectVersion\=${release_version}/" gradle.properties | |
echo "release_version=${release_version}" >> $GITHUB_OUTPUT | |
- name: SDKMAN! release | |
env: | |
GVM_SDKVENDOR_KEY: ${{ secrets.GVM_SDKVENDOR_KEY }} | |
GVM_SDKVENDOR_TOKEN: ${{ secrets.GVM_SDKVENDOR_TOKEN }} | |
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | |
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }} | |
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} | |
run: ./gradlew sdkRelease --no-daemon | |
gcr: | |
name: Deploy to Cloud Run | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Set the current release version | |
id: release_version | |
run: | | |
release_version=${GITHUB_REF:11} | |
sed -i "s/^projectVersion.*$/projectVersion\=${release_version}/" gradle.properties | |
echo "release_version=${release_version}" >> $GITHUB_OUTPUT | |
- name: Run Tests | |
run: ./gradlew starter-api:test starter-web-netty:test starter-gcp-function:shadowJar | |
env: | |
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | |
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }} | |
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} | |
- name: Build Docker image | |
run: | | |
./gradlew starter-web-netty:dockerBuild -PdockerImageName="gcr.io/${{ secrets.GCLOUD_PROJECT }}/micronaut-starter:${{ steps.release_version.outputs.release_version }}" | |
- name: Authenticate into Google Cloud Platform | |
uses: google-github-actions/setup-gcloud@v0.2.1 | |
with: | |
service_account_email: ${{ secrets.GCLOUD_EMAIL }} | |
service_account_key: ${{ secrets.GCLOUD_AUTH }} | |
- name: Configure Docker to use Google Cloud Platform | |
run: "gcloud auth configure-docker --quiet" | |
- name: Push image to Google Cloud Container Registry | |
run: | | |
./gradlew starter-web-netty:dockerPush -PdockerImageName="gcr.io/${{ secrets.GCLOUD_PROJECT }}/micronaut-starter:${{ steps.release_version.outputs.release_version }}" | |
- name: Deploy to Cloud Run | |
env: | |
release_version: ${{ steps.release_version.outputs.release_version }} | |
run: | | |
gcloud components install beta --quiet | |
gcloud beta run deploy micronaut-starter-latest --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/micronaut-starter:${{ steps.release_version.outputs.release_version }} --project ${{ secrets.GCLOUD_PROJECT }} --region us-central1 --update-env-vars=HOSTNAME="launch.micronaut.io",GITHUB_OAUTH_APP_CLIENT_ID=${{ secrets.GH_OAUTH_CLIENT_ID }},GITHUB_OAUTH_APP_CLIENT_SECRET=${{ secrets.GH_OAUTH_CLIENT_SECRET }} --platform managed --allow-unauthenticated --service-account=${{ secrets.GCLOUD_EMAIL }} | |
version="$(echo "${release_version//./}" | tr '[A-Z]' '[a-z]')" | |
gcloud beta run deploy "micronaut-starter-$version" --quiet --image gcr.io/${{ secrets.GCLOUD_PROJECT }}/micronaut-starter:${{ steps.release_version.outputs.release_version }} --project ${{ secrets.GCLOUD_PROJECT }} --region us-central1 --update-env-vars=HOSTNAME="launch.micronaut.io",GITHUB_OAUTH_APP_CLIENT_ID=${{ secrets.GH_OAUTH_CLIENT_ID }},GITHUB_OAUTH_APP_CLIENT_SECRET=${{ secrets.GH_OAUTH_CLIENT_SECRET }} --platform managed --allow-unauthenticated --service-account=${{ secrets.GCLOUD_EMAIL }} | |
homebrew: | |
name: Update Homebrew cask | |
needs: [macos, macos-arm] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout https://github.com/micronaut-projects/homebrew-tap | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
repository: micronaut-projects/homebrew-tap | |
- name: Download Intel ZIP | |
run: wget -q https://github.com/micronaut-projects/micronaut-starter/releases/download/${{ github.event.release.tag_name }}/mn-darwin-amd64-${{ github.event.release.tag_name }}.zip -O intel.zip | |
- name: Download Arm ZIP | |
run: wget -q https://github.com/micronaut-projects/micronaut-starter/releases/download/${{ github.event.release.tag_name }}/mn-darwin-aarch64-${{ github.event.release.tag_name }}.zip -O arm.zip | |
- name: Calculate SHA256 | |
id: sha | |
run: | | |
s=$(sha256sum intel.zip | awk '{ print $1 }') | |
echo "INTEL SHA256 is: $s" | |
echo "intelsha=${s}" >> $GITHUB_OUTPUT | |
s=$(sha256sum arm.zip | awk '{ print $1 }') | |
echo "ARM SHA256 is: $s" | |
echo "armsha=${s}" >> $GITHUB_OUTPUT | |
- name: Update Cask file | |
env: | |
INTELSHA: ${{ steps.sha.outputs.intelsha }} | |
ARMSHA: ${{ steps.sha.outputs.armsha }} | |
run: | | |
sed -i -e "s/ version.*/ version '${GITHUB_REF:11}'/" Casks/micronaut.rb | |
sed -i -e "s/ sha256 arm: '.*/ sha256 arm: '${ARMSHA}',/" Casks/micronaut.rb | |
sed -i -e "s/ intel: '.*/ intel: '${INTELSHA}'/" Casks/micronaut.rb | |
cat Casks/micronaut.rb | |
- uses: stefanzweifel/git-auto-commit-action@v5.0.1 | |
with: | |
commit_message: Update Micronaut cask to ${{ github.event.release.tag_name }} | |
commit_user_name: micronaut-build | |
commit_user_email: ${{ secrets.MICRONAUT_BUILD_EMAIL }} | |
commit_author: micronaut-build <${{ secrets.MICRONAUT_BUILD_EMAIL }}> | |
chocolatey: | |
name: Bump Chocolatey package | |
runs-on: windows-latest | |
needs: [windows] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.release.target_commitish }} | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Download ZIP, update versions and checksum | |
id: choco | |
working-directory: chocolatey | |
shell: pwsh | |
run: | | |
Invoke-RestMethod -Uri https://github.com/micronaut-projects/micronaut-starter/releases/download/${{ github.event.release.tag_name }}/mn-win-amd64-${{ github.event.release.tag_name }}.zip -OutFile 'mn.zip' | |
$SHA = (Get-FileHash ./mn.zip -Algorithm SHA256).Hash | |
echo $SHA | |
$Version = "${{ github.event.release.tag_name }}".substring(1) | |
echo $Version | |
#Fix semver | |
$NugetVersion = $Version | |
$Parts = $Version.Split(".") | |
if ($Parts.Count -eq 4) { | |
$NugetVersion = $Parts[0] + "." + $Parts[1] + "." + $Parts[2] + "-" + $Parts[3] | |
} | |
echo $NugetVersion | |
(Get-Content ./micronaut.nuspec) -replace '<version>.*</version>', "<version>$NugetVersion</version>" | Set-Content ./micronaut.nuspec | |
Get-Content ./micronaut.nuspec | |
(Get-Content ./tools/chocolateyinstall.ps1) -replace '^\$version.*', "`$version = '$Version'" | Set-Content ./tools/chocolateyinstall.ps1 | |
(Get-Content ./tools/chocolateyinstall.ps1) -replace ' checksum\s+=.*', " checksum = '$SHA'" | Set-Content ./tools/chocolateyinstall.ps1 | |
Get-Content ./tools/chocolateyinstall.ps1 | |
echo "nuget_version=$NugetVersion" >> $env:GITHUB_OUTPUT | |
- name: Create package | |
working-directory: chocolatey | |
run: choco pack | |
- name: Push package | |
working-directory: chocolatey | |
env: | |
API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }} | |
run: | | |
choco apikey --key $Env:API_KEY --source https://push.chocolatey.org/ | |
choco push micronaut.${{ steps.choco.outputs.nuget_version }}.nupkg --source https://push.chocolatey.org/ --force | |
- uses: stefanzweifel/git-auto-commit-action@v5.0.1 | |
with: | |
commit_message: Bump Micronaut Chocolatey package to ${{ github.event.release.tag_name }} | |
commit_user_name: micronaut-build | |
commit_user_email: ${{ secrets.MICRONAUT_BUILD_EMAIL }} | |
commit_author: micronaut-build <${{ secrets.MICRONAUT_BUILD_EMAIL }}> | |
backtosnapshots: | |
name: Core and Platform to Snapshot Versions | |
runs-on: ubuntu-latest | |
needs: [chocolatey, sdkman, gcr, homebrew] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
ref: ${{ github.event.release.target_commitish }} | |
- uses: gradle/wrapper-validation-action@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Back to Micronaut Core snapshot | |
continue-on-error: true | |
run: ./gradlew micronautCoreNextSnapshot | |
- name: Back to Micronaut Platform snapshot | |
continue-on-error: true | |
run: ./gradlew micronautPlatformNextSnapshot | |
- uses: stefanzweifel/git-auto-commit-action@v5.0.1 | |
continue-on-error: true | |
with: | |
commit_message: Back Core and Platform version to snapshot | |
commit_user_name: micronaut-build | |
commit_user_email: ${{ secrets.MICRONAUT_BUILD_EMAIL }} | |
commit_author: micronaut-build <${{ secrets.MICRONAUT_BUILD_EMAIL }}> | |
file_pattern: gradle.properties |