-
Notifications
You must be signed in to change notification settings - Fork 67
134 lines (121 loc) · 5.27 KB
/
Copy pathcheck_packages.yml
File metadata and controls
134 lines (121 loc) · 5.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: check packages and release to upm
on:
workflow_call:
inputs:
plugin_version:
required: true
type: string
package_artifact_name:
description: "Workflow artifact containing production-built Unity packages"
required: false
type: string
default: ""
permissions:
actions: read
contents: write
jobs:
check-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: master
- name: Download production packages
if: inputs.package_artifact_name != ''
uses: actions/download-artifact@v4
with:
name: ${{ inputs.package_artifact_name }}
path: .
- name: get version
run: |
echo "PLUGIN_VERSION=${{ inputs.plugin_version }}" >> "$GITHUB_ENV"
- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: install python packages
run: |
python -m pip install --upgrade pip
pip install unitypackage_extractor
- name: execute py script
run:
python .github/workflows/Scripts/extractPackage.py appsflyer-unity-plugin-${{env.PLUGIN_VERSION}}.unitypackage strict-mode-sdk/appsflyer-unity-plugin-strict-mode-${{env.PLUGIN_VERSION}}.unitypackage
- name: validate production metadata
run: |
python .github/workflows/Scripts/validate-production-package.py \
--version "${{ env.PLUGIN_VERSION }}" \
--regular "appsflyer-unity-plugin-${{ env.PLUGIN_VERSION }}.unitypackage" \
--strict "strict-mode-sdk/appsflyer-unity-plugin-strict-mode-${{ env.PLUGIN_VERSION }}.unitypackage"
release-upm:
runs-on: ubuntu-latest
needs: check-packages
steps:
- uses: actions/checkout@v4
- name: split branch
env:
COMMIT_AUTHOR: ${{ secrets.CI_USERNAME }}
COMMIT_EMAIL: ${{ secrets.CI_EMAIL }}
run: |
git branch -d upm &> /dev/null || echo upm branch not found
git subtree split -P Assets/AppsFlyer -b upm
git checkout upm
echo "Checked out to upm branch"
git config --global user.name "$COMMIT_AUTHOR"
git config --global user.email "$COMMIT_EMAIL"
git rm -r Tests
git commit -m "Remove Tests folder from upm branch"
echo "Removed Tests folder"
git push -f -u origin upm
- name: create tag
run: |
git tag "v${{inputs.plugin_version}}"
git push origin "v${{inputs.plugin_version}}"
echo "Release v${{inputs.plugin_version}} to upm :bookmark:"
strict-upm:
runs-on: ubuntu-latest
needs: check-packages
steps:
- uses: actions/checkout@v4
- name: split branch
env:
COMMIT_AUTHOR: ${{ secrets.CI_USERNAME }}
COMMIT_EMAIL: ${{ secrets.CI_EMAIL }}
run: |
git branch -d Strict-upm &> /dev/null || echo Strict-upm branch not found
git subtree split -P Assets/AppsFlyer -b Strict-upm
git checkout Strict-upm
echo "Checked out to Strict-upm branch"
git config --global user.name "$COMMIT_AUTHOR"
git config --global user.email "$COMMIT_EMAIL"
git rm -r Tests
git commit -m "Remove Tests folder from Strict-upm branch"
echo "Removed Tests folder"
- name: Modify for strict mode
run: |
echo "Changing AppsFlyerFramework to Strict Mode"
grep -q "AppsFlyerFramework" Editor/AppsFlyerDependencies.xml
sed -i 's/AppsFlyerFramework/AppsFlyerFramework\/Strict/g' Editor/AppsFlyerDependencies.xml
echo "Changing package.json to Strict Mode"
grep -q "AppsFlyer Unity plugin" ./package.json
sed -i 's/AppsFlyer Unity plugin/AppsFlyer Unity plugin strict mode/g' ./package.json
echo "Commenting out disableAdvertisingIdentifier"
grep -q "\[AppsFlyerLib shared\].disableAdvertisingIdentifier" Plugins/iOS/AppsFlyeriOSWrapper.mm
sed -i 's/\[AppsFlyerLib shared\].disableAdvertisingIdentifier/\/\/\[AppsFlyerLib shared\].disableAdvertisingIdentifier/g' Plugins/iOS/AppsFlyeriOSWrapper.mm
echo "Commenting out waitForATTUserAuthorizationWithTimeoutInterval"
grep -q "\[\[AppsFlyerLib shared\] waitForATTUserAuthorizationWithTimeoutInterval:timeoutInterval\];" Plugins/iOS/AppsFlyeriOSWrapper.mm
sed -i 's/\[\[AppsFlyerLib shared\] waitForATTUserAuthorizationWithTimeoutInterval:timeoutInterval\];/\/\/\[\[AppsFlyerLib shared\] waitForATTUserAuthorizationWithTimeoutInterval:timeoutInterval\];/g' Plugins/iOS/AppsFlyeriOSWrapper.mm
- name: Commit changes and push
env:
COMMIT_AUTHOR: ${{ secrets.CI_USERNAME }}
COMMIT_EMAIL: ${{ secrets.CI_EMAIL }}
run: |
git config user.name "$COMMIT_AUTHOR"
git config user.email "$COMMIT_EMAIL"
git add -A
git commit -m "update package.json"
git push -f -u origin Strict-upm
- name: create tag
run: |
git tag "Strict-v${{inputs.plugin_version}}"
git push origin "Strict-v${{inputs.plugin_version}}"
echo "Release Strict mode v${{inputs.plugin_version}} to upm :bookmark:"