fix: Release please handle versioning (#47) #50
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
on: | |
push: | |
branches: | |
- main | |
name: Run Release Please | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
# Release-please creates a PR that tracks all changes | |
steps: | |
- uses: google-github-actions/release-please-action@v3 | |
id: release | |
with: | |
release-type: simple | |
command: manifest | |
token: ${{secrets.GITHUB_TOKEN}} | |
default-branch: main | |
- name: Dump Release Please Output | |
env: | |
RELEASE_PLEASE_OUTPUT: ${{ toJson(steps.release.outputs) }} | |
run: | | |
echo "$RELEASE_PLEASE_OUTPUT" | |
# Outputs are namespaced by package when using a manifest in Release Please | |
outputs: | |
release_created: ${{ steps.release.outputs['OpenFeature--release_created'] }} | |
# Version doesn't include `v` as a prefix. This is undocumented | |
version: ${{ steps.release.outputs['OpenFeature--version'] }} | |
upload_url: ${{ steps.release.outputs['OpenFeature--upload_url'] }} | |
kotlin-release: | |
needs: release-please | |
runs-on: ubuntu-latest | |
if: ${{ needs.release-please.outputs.release_created }} | |
steps: | |
# The logic below handles the github release: | |
- name: Cache Gradle and wrapper | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
- name: Grant Permission for Gradlew to Execute | |
run: chmod +x gradlew | |
- name: Build AAR ⚙️🛠 | |
run: bash ./gradlew :openfeature:assemble | |
- name: Upload Openfeature SDK AAR 🗳 | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release-please.outputs.upload_url }} | |
asset_path: OpenFeature/build/outputs/aar/OpenFeature-release.aar | |
asset_name: openfeature-sdk.aar | |
asset_content_type: application/aar |