Skip to content

Updated models and APIs #231

Updated models and APIs

Updated models and APIs #231

Workflow file for this run

name: Release packages
on:
pull_request:
types:
- closed
branches:
- develop
jobs:
release:
if: github.event.pull_request.merged == true
runs-on: self-hosted
steps:
- name: Check if curl is installed, otherwise install it
run: |
brew list curl || brew install curl
- name: Set openssl and curl paths
id: set-paths
run: |
openssl_lib_path=$(brew --prefix openssl)/lib
curl_lib_path=$(brew --prefix curl)/lib
echo "LIB_PATHS=${openssl_lib_path};${curl_lib_path}" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
submodules: 'recursive'
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Get Previous tag
id: previoustag
run: |
TAG=$(git describe --tags $(git rev-list --tags --max-count=1) 2>/dev/null)
if [ -z "$TAG" ]; then
TAG="0.0.0"
fi
echo "VERSION=$TAG" >> $GITHUB_OUTPUT
- name: Get next versions
id: semvers
run: |
VERSION=${{ steps.previoustag.outputs.VERSION }}
IFS='.' read -r -a version_parts <<< "$VERSION"
MAJOR=${version_parts[0]}
MINOR=${version_parts[1]}
PATCH=${version_parts[2]}
echo "major=$((MAJOR + 1)).0.0" >> $GITHUB_OUTPUT
echo "minor=$MAJOR.$((MINOR + 1)).0" >> $GITHUB_OUTPUT
echo "patch=$MAJOR.$MINOR.$((PATCH + 1))" >> $GITHUB_OUTPUT
- name: Default new version
run: echo "NEW_VERSION=${{ steps.semvers.outputs.patch }}" >> $GITHUB_ENV
- name: Update major version
if: ${{ contains(github.event.pull_request.labels.*.name, 'SemVer.major') }}
run: echo "NEW_VERSION=${{ steps.semvers.outputs.major }}" >> $GITHUB_ENV
- name: Update minor version
if: ${{ contains(github.event.pull_request.labels.*.name, 'SemVer.minor') }}
run: echo "NEW_VERSION=${{ steps.semvers.outputs.minor }}" >> $GITHUB_ENV
- name: Update patch version
if: ${{ contains(github.event.pull_request.labels.*.name, 'SemVer.patch') }}
run: echo "NEW_VERSION=${{ steps.semvers.outputs.patch }}" >> $GITHUB_ENV
- name: Setup Android SDK
uses: amyu/setup-android@v4
with:
sdk-version: 34
ndk-version: 23.1.7779620
- name: Build and push
run: |
./gradlew -x test :cardinal-sdk:publishAllPublicationsToTaktikRepository --stacktrace
env:
ORG_GRADLE_PROJECT_repoUsername: ${{ secrets.REPO_USERNAME }}
ORG_GRADLE_PROJECT_repoPassword: ${{ secrets.REPO_PASSWORD }}
ORG_GRADLE_PROJECT_mavenReleasesRepository: ${{ secrets.MAVEN_RELEASES_REPOSITORY }}
ORG_GRADLE_PROJECT_mavenSnapshotsRepository: ${{ secrets.MAVEN_SNAPSHOT_REPOSITORY }}
ORG_GRADLE_PROJECT_mavenRepository: ${{ secrets.MAVEN_REPOSITORY }}
ORG_GRADLE_PROJECT_version: ${{ env.NEW_VERSION }}
ORG_GRADLE_PROJECT_cinteropsLibsDir: ${{ env.LIB_PATHS }}
ANDROID_HOME: ~/android/sdk # The Android SDK is installed here from the setup-android action
- name: Upload Release
run: |
curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/icure/icure-multiplatform-sdk/releases -d '{"tag_name":"${{ env.NEW_VERSION }}","target_commitish":"develop","name":"${{ env.NEW_VERSION }}","draft":false,"prerelease":false,"generate_release_notes":true}'
# gh release create ${{ env.NEW_VERSION }} -t ${{ steps.previoustag.outputs.VERSION }} -n "Release ${{ env.NEW_VERSION }}" --generate-notes