refactor dependency structure for new KMP version #392
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: Complete Build | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
env: | |
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false" | |
jobs: | |
build-smartype: | |
name: "Build Smartype" | |
runs-on: macOS-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108 | |
with: | |
ruby-version: '3.1.0' | |
- uses: actions/checkout@v2 | |
- name: set up JDK 1.15 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.15 | |
- name: Install Cocoapods | |
run: sudo gem install cocoapods; sudo gem install cocoapods-generate | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '12.x' | |
- name: Publish all | |
run: ./gradlew publishToMavenLocal | |
env: | |
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Archive maven | |
uses: actions/upload-artifact@v2 | |
with: | |
name: generator-maven | |
path: | | |
~/.m2/repository/com/mparticle | |
- name: Archive generator jar | |
uses: actions/upload-artifact@v2 | |
with: | |
name: generator-jar | |
path: | | |
smartype-generator/build/libs | |
build-web-example: | |
name: "Build Web Example" | |
needs: build-smartype | |
defaults: | |
run: | |
working-directory: examples/webExample | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: set up JDK 1.15 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.15 | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '12.x' | |
- name: pre-create maven dir | |
run: | | |
mkdir -p ~/.m2/repository/com/mparticle | |
- name: Download maven repo | |
uses: actions/download-artifact@v2 | |
with: | |
name: generator-maven | |
path: ~/.m2/repository/com/mparticle | |
- name: Download generator | |
uses: actions/download-artifact@v2 | |
with: | |
name: generator-jar | |
path: examples/webExample | |
- name: rename generator jar | |
run: | | |
rm -f smartype-generator-*-*.jar | |
mv smartype-generator-*.jar smartype.jar | |
- name: Run smartype | |
run: | | |
java -jar smartype.jar generate | |
- name: Install dependencies | |
run: npm install | |
- name: Build web app | |
run: npm run build | |
- name: Run Tests | |
working-directory: test-json | |
run: bash run-all-tests.sh --platform=web --jar=../examples/webExample/smartype.jar | |
build-android-example: | |
name: "Build Android Example" | |
needs: build-smartype | |
defaults: | |
run: | |
working-directory: examples/androidExample | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: set up JDK 1.15 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.15 | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '12.x' | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v2 | |
- name: pre-create maven dir | |
run: | | |
mkdir -p ~/.m2/repository/com/mparticle | |
- name: Download maven repo | |
uses: actions/download-artifact@v2 | |
with: | |
name: generator-maven | |
path: ~/.m2/repository/com/mparticle | |
- name: Download generator | |
uses: actions/download-artifact@v2 | |
with: | |
name: generator-jar | |
path: examples/androidExample | |
- name: rename generator jar | |
run: | | |
rm -f smartype-generator-*-*.jar | |
mv smartype-generator-*.jar smartype.jar | |
- name: Run smartype | |
run: | | |
java -jar smartype.jar generate | |
- name: Assemble Android App | |
run: ./gradlew assembleRelease | |
- name: Run Tests | |
working-directory: test-json | |
run: bash run-all-tests.sh --platform=android --jar=../examples/androidExample/smartype.jar | |
build-ios-example: | |
name: "Build iOS Example" | |
needs: build-smartype | |
defaults: | |
run: | |
working-directory: examples/iosExample | |
runs-on: macOS-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108 | |
with: | |
ruby-version: '3.1.0' | |
- uses: actions/checkout@v2 | |
- name: set up JDK 1.15 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.15 | |
- name: Install Cocoapods | |
run: sudo gem install cocoapods; sudo gem install cocoapods-generate | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '12.x' | |
- name: pre-create maven dir | |
run: | | |
mkdir -p ~/.m2/repository/com/mparticle | |
- name: Download maven repo | |
uses: actions/download-artifact@v2 | |
with: | |
name: generator-maven | |
path: ~/.m2/repository/com/mparticle | |
- name: Download generator | |
uses: actions/download-artifact@v2 | |
with: | |
name: generator-jar | |
path: examples/iosExample | |
- name: rename generator jar | |
run: | | |
rm -f smartype-generator-*-*.jar | |
mv smartype-generator-*.jar smartype.jar | |
- name: Run smartype | |
env: | |
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
java -jar smartype.jar generate --config=SmartypeExample/smartype.config.json | |
- name: Run Tests | |
working-directory: test-json | |
run: bash run-all-tests.sh --platform=ios --jar=../examples/iosExample/smartype.jar | |
generate-all: | |
name: "Generate, All Platforms " | |
needs: build-smartype | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108 | |
with: | |
ruby-version: '3.1.0' | |
- uses: actions/checkout@v2 | |
- name: set up JDK 1.15 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.15 | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '12.x' | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v2 | |
- name: Install Cocoapods | |
run: sudo gem install cocoapods; sudo gem install cocoapods-generate | |
- name: pre-create maven dir | |
run: | | |
mkdir -p ~/.m2/repository/com/mparticle | |
- name: Download maven repo | |
uses: actions/download-artifact@v2 | |
with: | |
name: generator-maven | |
path: ~/.m2/repository/com/mparticle | |
- name: Download generator | |
uses: actions/download-artifact@v2 | |
with: | |
name: generator-jar | |
- name: rename generator jar | |
run: | | |
rm -f smartype-generator-*-*.jar | |
mv smartype-generator-*.jar smartype.jar | |
- name: Run smartype | |
env: | |
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
java -jar smartype.jar generate | |
publish: | |
name: "Publish" | |
runs-on: macOS-latest | |
if: github.ref == 'refs/heads/main' | |
needs: [build-web-example, build-ios-example, build-android-example, generate-all] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108 | |
with: | |
ruby-version: '3.1.0' | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: set up JDK 1.15 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.15 | |
- name: Install Cocoapods | |
run: sudo gem install cocoapods; sudo gem install cocoapods-generate | |
- name: Upload Artifacts | |
run: ./gradlew publishAllPublicationsToStagingRepository | |
env: | |
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.MAVEN_CENTRAL_SIGNING_KEY }} | |
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.MAVEN_CENTRAL_SIGNING_KEY_PASSWORD }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
automerge: | |
name: "Automerge Dependabot PRs" | |
runs-on: ubuntu-18.04 | |
needs: [build-ios-example, build-android-example, build-web-example, generate-all] | |
if: github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' | |
steps: | |
- name: Rebase Dependabot PR | |
uses: actions/github-script@v3 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
github.pulls.merge({ | |
owner: context.repo.owner, | |
repo: context.payload.repository.name, | |
pull_number: context.payload.pull_request.number, | |
merge_method: 'rebase' | |
}); |