-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from AppsFlyerSDK/releases/6.x.x/6.10.x/6.10.3…
…-rc1 Releases/6.x.x/6.10.x/6.10.3 rc1
- Loading branch information
Showing
19 changed files
with
1,044 additions
and
587 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Build apps with AppsFlyer plugin | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
Build-Capacitor-android: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '11' | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
|
||
|
||
- name: Install plugin dependencies | ||
run: npm install | ||
- name: Build plugin | ||
run: npm run build | ||
- name: install capacitor-appsflyer on an Android app | ||
run: | | ||
cd examples/CapacitorReact | ||
npm install ../../ | ||
npx cap add android | ||
npm run build | ||
npx cap sync android | ||
- name: Build apk | ||
run: | | ||
cd examples/CapacitorReact/android | ||
echo "pwd: $(pwd)" | ||
gradle wrapper | ||
echo "ls: $(ls)" | ||
chmod +x ./gradlew | ||
./gradlew wrapper --gradle-version 7.6.1 | ||
./gradlew clean assembleRelease | ||
# Build-Capacitor-ios: | ||
# runs-on: macos-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - name: install react-native-appsflyer on an iOS app | ||
# run: | | ||
# cd demos/appsflyer-react-native-app | ||
# yarn install --force | ||
# yarn add ../../ --save | ||
# - name: Install Dependencies | ||
# run: | | ||
# cd demos/appsflyer-react-native-app/ios | ||
# pod install --repo-update | ||
|
||
# - name: Setup provisioning profile | ||
# env: | ||
# IOS_KEYS: ${{ secrets.IOS_KEYS }} | ||
# run: | | ||
# chmod +x .github/workflows/scripts/decryptSecrets.sh | ||
# ./.github/workflows/scripts/decryptSecrets.sh | ||
# - name: Archive app | ||
# run: | | ||
# sudo xcode-select --switch /Applications/Xcode_12.5.1.app | ||
# chmod +x .github/workflows/scripts/archiveApp.sh | ||
# cd demos/appsflyer-react-native-app/ios | ||
# ./../../../.github/workflows/scripts/archiveApp.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
# This workflow close issue and add comment after the issue labaled as 'inactive' | ||
|
||
name: Close issue | ||
on: | ||
issues: | ||
types: | ||
- labeled | ||
jobs: | ||
close-inactive-issue: | ||
if: github.event.label.name == 'Inactive' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Close issue due to inactivity | ||
uses: peter-evans/close-issue@v2 | ||
with: | ||
issue-number: ${{ github.event.issue.number }} | ||
comment: | | ||
This issue is closed due to inactivity. If the issue continue, please open a new one. |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Deploy To QA | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
Deploy-to-QA: | ||
runs-on: ubuntu-latest | ||
environment: Staging | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
- name: Install dependency | ||
run: | | ||
npm i rimraf | ||
- name: Login to Github | ||
env: | ||
COMMIT_AUTHOR: ${{ secrets.CI_COMMIT_AUTHOR }} | ||
COMMIT_EMAIL: ${{ secrets.CI_COMMIT_EMAIL }} | ||
run: | | ||
git config --global user.name $COMMIT_AUTHOR | ||
git config --global user.email $COMMIT_EMAIL | ||
- uses: mdecoleman/[email protected] | ||
id: vars | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Export branch name | ||
run: | | ||
echo "RELEASE_BRANCH_NAME=${{ steps.vars.outputs.branch }}" >> $GITHUB_ENV | ||
- name: Check if fixed version is on Jira | ||
env: | ||
JIRA_TOKEN: ${{ secrets.CI_JIRA_TOKEN }} | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
|
||
run: | | ||
fixed_version_found=false | ||
plugin_version=$(echo "$BRANCH_NAME" | grep -Eo '[0-9]+.[0-9]+.[0-9]+') | ||
jira_fixed_version="Capacitor SDK v$plugin_version" | ||
echo "PLUGIN_VERSION=$plugin_version" >> $GITHUB_ENV | ||
echo "JIRA_FIXED_VERSION=$jira_fixed_version" >> $GITHUB_ENV | ||
chmod +x .github/workflows/scripts/releaseNotesGenerator.sh | ||
.github/workflows/scripts/releaseNotesGenerator.sh $JIRA_TOKEN "$jira_fixed_version" | ||
- name: Build Plugin | ||
run: | | ||
npm run build | ||
- name: Push to NPM | ||
env: | ||
CI_NPM_TOKEN: ${{ secrets.CI_NPM_TOKEN }} | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=$CI_NPM_TOKEN" > ~/.npmrc | ||
npm publish --tag QA | ||
- name: Generate and send slack report | ||
env: | ||
SLACK_TOKEN: ${{ secrets.CI_SLACK_TOKEN }} | ||
JIRA_TOKEN: ${{ secrets.CI_JIRA_TOKEN }} | ||
JIRA_FIXED_VERSION: "Capacitor SDK v${{env.PLUGIN_VERSION}}" | ||
RELEASE_BRANCH_NAME: ${{env.RELEASE_BRANCH_NAME}} | ||
run: | | ||
ANDROID_SDK_VERSION=`cat package.json | jq .androidSdkVersion` | ||
IOS_SDK_VERSION=`cat package.json | jq .iosSdkVersion` | ||
PLUGIN_VERSION=`cat package.json | jq .version` | ||
BUILD_NUMBER=`cat package.json | jq .buildNumber` | ||
chmod +x .github/workflows/scripts/releaseNotesGenerator.sh | ||
.github/workflows/scripts/releaseNotesGenerator.sh $JIRA_TOKEN "$JIRA_FIXED_VERSION" | ||
CHANGES=$(cat "$JIRA_FIXED_VERSION-releasenotes".txt) | ||
curl -X POST -H 'Content-type: application/json' --data '{"jira_fixed_version": "'"${{env.JIRA_FIXED_VERSION}}"'", "deploy_type": "QA", "install_tag": "QA", "git_branch": "'"$RELEASE_BRANCH_NAME"'", "changes_and_fixes": "'"$CHANGES"'", "plugin_version": "'"${{env.PLUGIN_VERSION}}"'", "android_dependency": "'"$ANDROID_SDK_VERSION"'", "ios_dependency": "'"$IOS_SDK_VERSION"'"}' "$SLACK_TOKEN" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Prepare plugin for production | ||
|
||
on: | ||
pull_request: | ||
types: [ labeled ] | ||
|
||
jobs: | ||
Prepare-Plugin-For-Production: | ||
if: startsWith(github.head_ref, 'releases/') && github.event.label.name == 'Ready For Production' | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Login to Github | ||
env: | ||
COMMIT_AUTHOR: ${{ secrets.CI_COMMIT_AUTHOR }} | ||
COMMIT_EMAIL: ${{ secrets.CI_COMMIT_EMAIL }} | ||
run: | | ||
git config --global user.name $COMMIT_AUTHOR | ||
git config --global user.email $COMMIT_EMAIL | ||
- uses: mdecoleman/[email protected] | ||
id: vars | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Update package.json file | ||
run: | | ||
plugin_version=$(echo "${{ steps.vars.outputs.branch }}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+') | ||
# we export plugin_version and release branch name as env so we can use them in the next step | ||
echo "PLUGIN_VERSION=$plugin_version" >> $GITHUB_ENV | ||
echo "GIT_BRANCH_RELEASE=${{ steps.vars.outputs.branch }}" >> $GITHUB_ENV | ||
echo "Updating plugin to version $plugin_version" | ||
chmod +x .github/workflows/scripts/updatePluginVersion.sh | ||
chmod +x .github/workflows/scripts/updateBuildNumber.sh | ||
.github/workflows/scripts/updatePluginVersion.sh $plugin_version | ||
.github/workflows/scripts/updateBuildNumber.sh ${{github.run_number}} | ||
git commit -m "Update Plugin Version" | ||
git push origin HEAD:${{ steps.vars.outputs.branch }} --force | ||
- name: Update CHANGELOG.md | ||
env: | ||
JIRA_TOKEN: ${{ secrets.CI_JIRA_TOKEN }} | ||
JIRA_FIXED_VERSION: "Capacitor SDK v${{env.PLUGIN_VERSION}}" | ||
run: | | ||
chmod +x .github/workflows/scripts/releaseNotesGenerator.sh | ||
.github/workflows/scripts/releaseNotesGenerator.sh $JIRA_TOKEN "$JIRA_FIXED_VERSION" | ||
NEW_VERSION_RELEASE_NOTES=$(cat "$JIRA_FIXED_VERSION-releasenotes".txt) | ||
NEW_VERSION_SECTION="## ${{ env.PLUGIN_VERSION }}\n Release date: *$(date +%F)*\n\n$NEW_VERSION_RELEASE_NOTES\n" | ||
echo -e "$NEW_VERSION_SECTION\n$(cat CHANGELOG.md)" > CHANGELOG.md | ||
git add CHANGELOG.md | ||
git commit -m "Update CHANGELOG.md" | ||
git push origin HEAD:${{ env.GIT_BRANCH_RELEASE }} --force | ||
Approve-Pull-Request: | ||
needs: [ Prepare-Plugin-For-Production ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: mdecoleman/[email protected] | ||
id: vars | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Export branch name | ||
run: | | ||
echo "RELEASE_BRANCH_NAME=${{ steps.vars.outputs.branch }}" >> $GITHUB_ENV | ||
- name: approve pull request | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PR_NUMBER: ${{ github.event.pull_request.number }} | ||
run: | # approve the pull request of the current branch | ||
gh pr review "$PR_NUMBER" --approve |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: Release plugin to production | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- 'main' | ||
paths-ignore: | ||
- '**.md' | ||
- '**.yml' | ||
- 'examples/**' | ||
- 'docs/**' | ||
- 'assets/**' | ||
jobs: | ||
# Pre-Release-To-Prod: | ||
# if: github.event.pull_request.merged == true | ||
# uses: ./.github/workflows/pre-release-workflow.yml | ||
# secrets: inherit | ||
|
||
Build-Sample-Apps: | ||
# needs: [ Pre-Release-To-Prod ] | ||
uses: ./.github/workflows/build-apps-workflow.yml | ||
secrets: inherit | ||
|
||
Deploy-To-Production: | ||
needs: [ Build-Sample-Apps ] | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
- name: Install dependency | ||
run: | | ||
npm i rimraf | ||
- name: Login to Github | ||
env: | ||
COMMIT_AUTHOR: ${{ secrets.CI_COMMIT_AUTHOR }} | ||
COMMIT_EMAIL: ${{ secrets.CI_COMMIT_EMAIL }} | ||
run: | | ||
git config --global user.name $COMMIT_AUTHOR | ||
git config --global user.email $COMMIT_EMAIL | ||
- uses: mdecoleman/[email protected] | ||
id: vars | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Determine release tag and release branch | ||
run: | | ||
TAG=$(echo "${{ steps.vars.outputs.branch }}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+') | ||
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV | ||
echo "RELEASE_BRANCH_NAME=${{ steps.vars.outputs.branch }}" >> $GITHUB_ENV | ||
echo "push new release >> $TAG" | ||
- name: "Create release" | ||
env: | ||
TAG: ${{env.PLUGIN_VERSION}} | ||
uses: "actions/github-script@v5" | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
script: | | ||
try { | ||
await github.rest.repos.createRelease({ | ||
draft: false, | ||
generate_release_notes: false, | ||
name: process.env.TAG, | ||
owner: context.repo.owner, | ||
prerelease: false, | ||
repo: context.repo.repo, | ||
tag_name: process.env.TAG | ||
}); | ||
} catch (error) { | ||
core.setFailed(error.message); | ||
} | ||
- name: Push to NPM | ||
env: | ||
CI_NPM_TOKEN: ${{ secrets.CI_NPM_TOKEN }} | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=$CI_NPM_TOKEN" > ~/.npmrc | ||
npm run build | ||
npm publish | ||
- name: Generate and send slack report | ||
env: | ||
SLACK_TOKEN: ${{ secrets.CI_SLACK_TOKEN }} | ||
JIRA_TOKEN: ${{ secrets.CI_JIRA_TOKEN }} | ||
JIRA_FIXED_VERSION: "Capacitor SDK v${{env.PLUGIN_VERSION}}" | ||
run: | | ||
ANDROID_SDK_VERSION=`cat package.json | jq .androidSdkVersion` | ||
IOS_SDK_VERSION=`cat package.json | jq .iosSdkVersion` | ||
PLUGIN_VERSION=`cat package.json | jq .version` | ||
BUILD_NUMBER=`cat package.json | jq .buildNumber` | ||
chmod +x .github/workflows/scripts/releaseNotesGenerator.sh | ||
.github/workflows/scripts/releaseNotesGenerator.sh $JIRA_TOKEN "$JIRA_FIXED_VERSION" | ||
CHANGES=$(cat "$JIRA_FIXED_VERSION-releasenotes".txt) | ||
curl -X POST -H 'Content-type: application/json' --data '{"jira_fixed_version": "'"${{env.JIRA_FIXED_VERSION}}"'", "deploy_type": "Production", "install_tag": "latest", "git_branch": "'"$RELEASE_BRANCH_NAME"'", "changes_and_fixes": "'"$CHANGES"'", "plugin_version": "'"${{env.PLUGIN_VERSION}}"'", "android_dependency": "'"$ANDROID_SDK_VERSION"'", "ios_dependency": "'"$IOS_SDK_VERSION"'"}' "$SLACK_TOKEN" |
Oops, something went wrong.