-
Notifications
You must be signed in to change notification settings - Fork 6
Feature/ios release scripts #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a0bce49
Make XCFramework by using gradle plugin
pavlo-davydiuk b26ec2d
Add podspec
pavlo-davydiuk d2cf82b
Add release workflow, fix building
pavlo-davydiuk 95a3fff
Fix build workflow
pavlo-davydiuk bf0abb8
Modify description
pavlo-davydiuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
name: Build libraries | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, synchronize] | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
build: | ||
name: Build libraries | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
build: | ||
name: Build libraries | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Check | ||
run: ./gradlew detekt | ||
- name: Check | ||
run: ./gradlew detekt | ||
|
||
- name: Build project | ||
run: ./gradlew build | ||
- name: Build project | ||
run: ./gradlew build | ||
|
||
- name: Build xcframework | ||
run: ./createXCFrameworks.sh | ||
- name: Build XCFramework | ||
run: ./gradlew assembleJsonLogicKMPXCFramework |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,43 @@ | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: [ created ] | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
publish: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
publish_to_maven: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 11 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: "temurin" | ||
java-version: 11 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Publish to maven central | ||
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository | ||
env: | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | ||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | ||
GPG_PRIVATE_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }} | ||
- name: Publish to maven central | ||
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository | ||
env: | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | ||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | ||
GPG_PRIVATE_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }} | ||
|
||
publish_to_cocoapods: | ||
name: Publish to cocoadpods | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Publish to cocoadpods | ||
env: | ||
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} | ||
run: | | ||
pod trunk push JsonLogicKMP.podspec |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
next_version: | ||
description: "Next version (if empty - PATCH version will be incremented automatically). Please use semantic versioning, format: 0.0.1" | ||
required: false | ||
|
||
env: | ||
podspec_name: "JsonLogicKMP.podspec" | ||
xcframework_name: "JsonLogicKMP.xcframework" | ||
xcframework_zip_name: "JsonLogicKMP.xcframework.zip" | ||
xcframework_artifact_key: "xcframework" | ||
|
||
jobs: | ||
run_tests: | ||
name: Run tests | ||
if: github.ref == 'refs/heads/main' | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Check | ||
run: ./gradlew detekt | ||
|
||
- name: Build project | ||
run: ./gradlew build | ||
|
||
build_xcframework: | ||
name: Build XCFramework | ||
runs-on: macos-latest | ||
needs: [run_tests] | ||
outputs: | ||
sha256: ${{ steps.calculate_checksum.outputs.sha256 }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build XCFramework | ||
run: ./gradlew assembleJsonLogicKMPXCFramework | ||
|
||
- name: Zip XCFramework | ||
run: zip -r "${{ env.xcframework_zip_name }}" "build/XCFrameworks/release/${{ env.xcframework_name }}" | ||
|
||
- name: Calculate checksum | ||
id: calculate_checksum | ||
run: | | ||
XCFRAMEWORK_SHA256=$(shasum -a 256 JsonLogicKMP.xcframework.zip | awk '{ print $1 }') | ||
echo "::set-output name=sha256::$XCFRAMEWORK_SHA256" | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: "${{ env.xcframework_artifact_key }}" | ||
path: "${{ env.xcframework_zip_name }}" | ||
if-no-files-found: error | ||
retention-days: 1 | ||
|
||
create_release_branch: | ||
name: Create release branch and bump version | ||
runs-on: ubuntu-latest | ||
needs: [run_tests, build_xcframework] | ||
outputs: | ||
tag: ${{ steps.bump.outputs.next_tag }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get next tag | ||
id: "bump" | ||
uses: allegro-actions/next-version@v1 | ||
with: | ||
prefix: "" | ||
force: ${{ github.event.inputs.next_version }} | ||
|
||
- name: Change version in podspec file | ||
run: | | ||
VERSION=${{ steps.bump.outputs.next_tag }} | ||
sed -i -e "s/spec.version.*= .*$/spec\.version = \"$VERSION\"/g" "${{ env.podspec_name }}" | ||
|
||
- name: Change SHA256 in podspec file | ||
run: | | ||
XCFRAMEWORK_SHA256="${{ needs.build_xcframework.outputs.sha256 }}" | ||
sed -i -e "s/:sha256 => \"\"$/:sha256 => \"$XCFRAMEWORK_SHA256\"/g" "${{ env.podspec_name }}" | ||
|
||
- name: Setup git config | ||
run: | | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "<>" | ||
|
||
- name: Commit and push version bump | ||
run: | | ||
VERSION=${{ steps.bump.outputs.next_tag }} | ||
BRANCH_NAME=release/$VERSION | ||
git checkout -b $BRANCH_NAME | ||
git add "${{ env.podspec_name }}" | ||
git commit -m "Bump version to: $VERSION" | ||
git push -u origin $BRANCH_NAME | ||
git tag $VERSION | ||
git push origin tag $VERSION | ||
|
||
- name: Create pull request | ||
uses: repo-sync/pull-request@v2 | ||
with: | ||
source_branch: "release/${{ steps.bump.outputs.next_tag }}" | ||
destination_branch: "main" | ||
pr_title: "Bump version to ${{ steps.bump.outputs.next_tag }}" | ||
pr_body: "## Note:\n | ||
* This pull request is created by workflow 🤖\n | ||
## What:\n | ||
* bump version to ${{ steps.bump.outputs.next_tag }}\n | ||
* commit tag\n | ||
* updated podspec file\n | ||
## Why:\n | ||
* New release" | ||
pr_allow_empty: false | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
create_github_release: | ||
name: Create GitHub release | ||
runs-on: ubuntu-latest | ||
needs: [run_tests, build_xcframework, create_release_branch] | ||
steps: | ||
- name: Download XCFramework | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: "${{ env.xcframework_artifact_key }}" | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: "${{ needs.create_release_branch.outputs.tag }}" | ||
name: "Release ${{ needs.create_release_branch.outputs.tag }}" | ||
draft: false | ||
prerelease: false | ||
generate_release_notes: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
files: "${{ env.xcframework_zip_name }}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Pod::Spec.new do |spec| | ||
spec.name = "JsonLogicKMP" | ||
spec.version = "0.0.1" | ||
spec.summary = "Kotlin multiplatform JsonLogic" | ||
spec.description = <<-DESC | ||
* Kotlin multiplatform JsonLogic expressions evaluation engine | ||
DESC | ||
spec.homepage = "https://github.com/allegro/json-logic-kmp" | ||
spec.license = { :type => "The Apache License, Version 2.0", :file => "LICENSE" } | ||
spec.author = { "Allegro" => "opensource@allegro.pl" } | ||
|
||
spec.platform = :ios | ||
spec.ios.deployment_target = "13.0" | ||
|
||
spec.source = { :http => "#{spec.homepage}/releases/download/#{spec.version}/#{spec.name}.xcframework.zip", | ||
:sha256 => "" | ||
} | ||
|
||
spec.vendored_frameworks = "#{spec.name}.xcframework" | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.