-
Notifications
You must be signed in to change notification settings - Fork 9
feat: Add Rokt Kit package #47
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
15 commits
Select commit
Hold shift + click to select a range
9dbb79e
feat: Add Rokt Kit package
jamesnrokt b7b37bd
Apply suggestions from code review
jamesnrokt 698590d
Remove check for VERSION file changes
jamesnrokt f546767
Separate functions for easier testing
jamesnrokt ca0f478
Add token to PR creation
jamesnrokt 8660440
Change contents permission
jamesnrokt efd4395
Add symlink for README in plugin
jamesnrokt 9779da2
Merge branch 'feat/add-rokt-kit' of https://github.com/mParticle/cord…
jamesnrokt 2c45358
Add track conversion button to match Ads docs
jamesnrokt ab20811
Namespace Rokt functionality
jamesnrokt 6624cb3
Add prepublish step
jamesnrokt 7414125
chore: add additional meta data to package.json (#48)
rmi22186 d67a473
Apply suggestions from code review
jamesnrokt 95f5617
Update code format
jamesnrokt 8071b94
Merge branch 'main' into feat/add-rokt-kit
jamesnrokt 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 |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| name: Create draft release | ||
|
|
||
| on: | ||
| workflow_dispatch: # checkov:skip=CKV_GHA_7 | ||
| inputs: | ||
| bump-type: | ||
| description: Specify if the version should be bumped as major, minor, patch | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - major | ||
| - minor | ||
| - patch | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| publish-draft-release: | ||
| runs-on: macos-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 #6.0.0 | ||
| with: | ||
| node-version: 22 | ||
|
|
||
| - name: Get current version | ||
| id: version-file | ||
| run: | | ||
| version_from_file=$(head -n 1 VERSION) | ||
| echo "release-version=$version_from_file" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Bump version | ||
| id: bump-version | ||
| uses: actions-ecosystem/action-bump-semver@34e334551143a5301f38c830e44a22273c6ff5c5 # v1.0.0 | ||
| with: | ||
| current_version: ${{ steps.version-file.outputs.release-version }} | ||
| level: ${{ github.event.inputs.bump-type || 'patch' }} | ||
|
|
||
| - name: Save validated version to file | ||
| run: | | ||
| echo "${{ steps.bump-version.outputs.new_version }}" > VERSION | ||
|
|
||
| - name: Test Plugin | ||
| working-directory: plugin | ||
| run: npm test | ||
|
|
||
| - name: Update Plugin package.json | ||
| working-directory: plugin | ||
| run: | | ||
| npm version ${{ steps.bump-version.outputs.new_version }} --no-git-tag-version | ||
|
|
||
| - name: Update Rokt Kit package.json | ||
| working-directory: Kits/Rokt | ||
| run: | | ||
| npm version ${{ steps.bump-version.outputs.new_version }} --no-git-tag-version | ||
|
|
||
| - name: Publish Plugin to npm (dry-run) | ||
| working-directory: plugin | ||
| run: npm publish --dry-run | ||
|
|
||
| - name: Publish Rokt Kit to npm (dry-run) | ||
| working-directory: Kits/Rokt | ||
| run: npm publish --dry-run | ||
|
|
||
| - name: Update changelog | ||
| uses: thomaseizinger/keep-a-changelog-new-release@f62c3c390716df5af712ba5d94f4f4a8efc1306d # v3.1.0 | ||
| with: | ||
| tag: ${{ steps.bump-version.outputs.new_version }} | ||
| changelogPath: CHANGELOG.md | ||
|
|
||
| - name: Generate a token | ||
| id: generate-token | ||
| uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4 | ||
| with: | ||
| app-id: ${{ secrets.SDK_RELEASE_GITHUB_APP_ID }} | ||
| private-key: ${{ secrets.SDK_RELEASE_GITHUB_APP_PRIVATE_KEY }} | ||
| owner: ${{ github.repository_owner }} | ||
| repositories: | | ||
| cordova-plugin-mparticle | ||
|
|
||
| - name: Create Pull Request | ||
| uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 | ||
| with: | ||
| token: ${{ steps.generate-token.outputs.token }} | ||
| commit-message: 'Prepare release ${{ steps.bump-version.outputs.new_version }}' | ||
|
jamesnrokt marked this conversation as resolved.
|
||
| branch: release/${{ steps.bump-version.outputs.new_version }} | ||
| title: 'Prepare release ${{ steps.bump-version.outputs.new_version }}' | ||
| base: main | ||
| body: | | ||
| Preparing for release ${{ steps.bump-version.outputs.new_version }} | ||
|
|
||
| There should be 4 files that have been updated: | ||
| - plugin/package.json | ||
| - Kits/Rokt/package.json | ||
| - CHANGELOG.md | ||
| - VERSION | ||
|
|
||
| Additionally a dry-run publish was successfully run for the plugin and Rokt kit. | ||
| labels: | | ||
| release | ||
This file was deleted.
Oops, something went wrong.
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,78 @@ | ||
| name: Release NPM | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - VERSION | ||
|
|
||
| permissions: | ||
| id-token: write | ||
| contents: write | ||
|
|
||
| jobs: | ||
| setup-and-version: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| final_version: ${{ steps.version-file.outputs.release-version }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
|
|
||
| - name: Get current version | ||
| id: version-file | ||
| run: | | ||
| version_from_file=$(head -n 1 VERSION) | ||
| echo "release-version=$version_from_file" >> $GITHUB_OUTPUT | ||
|
|
||
| build-and-release: | ||
| needs: setup-and-version | ||
| runs-on: macos-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 #6.0.0 | ||
| with: | ||
| node-version: 22 | ||
| registry-url: https://registry.npmjs.org | ||
|
|
||
| - name: Install Plugin dependencies | ||
| working-directory: plugin | ||
| run: npm ci | ||
|
|
||
| - name: Test Plugin | ||
| working-directory: plugin | ||
| run: npm test | ||
|
|
||
| - name: Publish Plugin to npm | ||
| working-directory: plugin | ||
| run: npm publish | ||
|
|
||
| - name: Install Rokt Kit dependencies | ||
| working-directory: Kits/Rokt | ||
| run: npm ci | ||
|
|
||
| - name: Publish Rokt Kit to npm | ||
| working-directory: Kits/Rokt | ||
| run: npm publish | ||
|
jamesnrokt marked this conversation as resolved.
|
||
|
|
||
| - uses: ffurrer2/extract-release-notes@9989ccec43d726ef05aa1cd7b2854fb96b6df6ab # v2.2.0 | ||
| id: extract-release-notes | ||
| with: | ||
| changelog_file: CHANGELOG.md | ||
|
|
||
| - name: Changelog | ||
| run: echo "${{ steps.extract-release-notes.outputs.release_notes }}" | ||
|
|
||
| - name: Create Github release | ||
| uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0 | ||
| with: | ||
| makeLatest: true | ||
| tag: ${{ needs.setup-and-version.outputs.final_version }} | ||
| body: | | ||
| ## Release notes: | ||
| ${{ steps.extract-release-notes.outputs.release_notes }} | ||
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 |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # cordova-plugin-mparticle-kits-rokt | ||
|
|
||
| Cordova plugin that adds mParticle Rokt kit native dependencies to your project. | ||
|
|
||
| ## What This Plugin Does | ||
|
|
||
| This plugin automatically adds the following native dependencies: | ||
|
|
||
| - **Android**: `com.mparticle:android-rokt-kit:5.71.0` | ||
| - **iOS**: `mParticle-Rokt` version `8.3.0` | ||
|
|
||
| No additional configuration needed - just install the plugin and the dependencies will be added automatically when you build your project. |
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,24 @@ | ||
| { | ||
| "name": "cordova-plugin-mparticle-kits-rokt", | ||
| "version": "2.2.4", | ||
| "description": "Adds support for Rokt to your Cordova project", | ||
| "homepage": "https://www.mparticle.com", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/mParticle/cordova-plugin-mparticle", | ||
| "directory": "Kits/Rokt" | ||
| }, | ||
| "license": "Apache-2.0", | ||
| "publishConfig": { | ||
| "access": "public", | ||
| "provenance": true, | ||
| "registry": "https://registry.npmjs.org/" | ||
| }, | ||
| "cordova": { | ||
| "id": "cordova-plugin-mparticle-kits-rokt", | ||
| "platforms": [ | ||
| "android", | ||
| "ios" | ||
| ] | ||
| } | ||
| } |
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 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <plugin xmlns="http://cordova.apache.org/ns/plugins/1.0" | ||
| id="cordova-plugin-mparticle-kits-rokt" | ||
| version="2.2.4"> | ||
| <name>MParticle Rokt Kit</name> | ||
| <description>Adds support for Rokt to your Cordova project</description> | ||
| <platform name="android"> | ||
| <framework src="com.mparticle:android-rokt-kit:5.71.0"/> | ||
| </platform> | ||
| <platform name="ios"> | ||
| <podspec> | ||
| <config> | ||
| <source url="https://cdn.cocoapods.org/"/> | ||
| </config> | ||
| <pods use-frameworks="true"> | ||
| <pod name="mParticle-Rokt" spec="8.3.0" /> | ||
| </pods> | ||
| </podspec> | ||
| </platform> | ||
| </plugin> |
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 @@ | ||
| 2.2.4 |
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
This file was deleted.
Oops, something went wrong.
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.