6
6
version :
7
7
description : ' Version number'
8
8
required : true
9
+ pull_request :
10
+ types : [opened, synchronize]
11
+ branches :
12
+ - main
9
13
10
14
permissions :
11
15
id-token : write
12
- contents : read
16
+ contents : write
13
17
14
18
jobs :
15
19
update-sdk :
16
20
runs-on : macos-latest
17
21
18
22
steps :
19
23
- name : Checkout repository
20
- uses : actions/checkout@v2
24
+ uses : actions/checkout@v3
21
25
22
- - name : Ensure version input is provided
23
- run : |
24
- if [ -z "${{ github.event.inputs.version }}" ]; then
25
- echo "Error: Version number is required."
26
- exit 1
27
- fi
26
+ # - name: Ensure version input is provided
27
+ # run: |
28
+ # if [ -z "${{ github.event.inputs.version }}" ]; then
29
+ # echo "Error: Version number is required."
30
+ # exit 1
31
+ # fi
28
32
29
- - name : Check if version already exists
30
- run : |
31
- VERSION=${{ github.event.inputs.version }}
32
- if [ -d "OsanoConsentManagerSDK/${VERSION}" ]; then
33
- echo "Version ${VERSION} already exists. Exiting."
34
- exit 1
35
- fi
36
- working-directory : ${{ github.workspace }}
33
+ # - name: Check if version already exists
34
+ # run: |
35
+ # # VERSION=${{ github.event.inputs.version }}
36
+ # # VERSION=${{ github.event.inputs.version }}
37
+ # if [ -d "OsanoConsentManagerSDK/${VERSION}" ]; then
38
+ # echo "Version ${VERSION} already exists. Exiting."
39
+ # exit 1
40
+ # fi
41
+ # working-directory: ${{ github.workspace }}
37
42
38
43
- name : Download SDK zip
39
44
run : |
40
- VERSION=${{ github.event.inputs.version }}
45
+ # VERSION=${{ github.event.inputs.version }}
46
+ VERSION="3.3.2"
41
47
URL="https://libraries.osano.com/ios/OsanoConsentManagerSDK/OsanoConsentManagerSDK-${VERSION}.zip"
42
48
if ! curl --output /dev/null --silent --head --fail "$URL"; then
43
49
echo "Error: SDK zip for version ${VERSION} does not exist at ${URL}. Exiting."
44
50
exit 1
45
51
fi
46
52
curl -L $URL -o OsanoConsentManagerSDK-${VERSION}.zip
53
+ working-directory : ${{ github.workspace }}
54
+
47
55
48
56
- name : Compute checksum
49
57
run : |
58
+ # VERSION=${{ github.event.inputs.version }}
59
+ VERSION="3.3.2"
50
60
CHECKSUM=$(swift package compute-checksum OsanoConsentManagerSDK-${VERSION}.zip)
51
61
echo "CHECKSUM=$CHECKSUM" >> $GITHUB_ENV
52
62
rm OsanoConsentManagerSDK-${VERSION}.zip
63
+ working-directory : ${{ github.workspace }}
64
+
53
65
54
66
- name : Create new version folder
55
67
run : |
56
- VERSION=${{ github.event.inputs.version }}
57
- mkdir -p OsanoConsentManagerSDK/${VERSION}
68
+ # VERSION=${{ github.event.inputs.version }}
69
+ VERSION="3.3.2"
70
+ mkdir -p OsanoConsentManagerSDK/${VERSION}-test
58
71
working-directory : ${{ github.workspace }}
59
72
60
73
- name : Copy template.podspec and update attributes
61
74
run : |
62
- cp template.podspec OsanoConsentManagerSDK/${VERSION}/OsanoConsentManagerSDK.podspec
63
- VERSION=${{ github.event.inputs.version }}
75
+ # VERSION=${{ github.event.inputs.version }}
76
+ VERSION="3.3.2"
77
+ cp template.podspec OsanoConsentManagerSDK/${VERSION}-test/OsanoConsentManagerSDK.podspec
64
78
URL="https://libraries.osano.com/ios/OsanoConsentManagerSDK/OsanoConsentManagerSDK-${VERSION}.zip"
65
79
sed -i '' "s|s.version = '<version>'|s.version = '${VERSION}'|" OsanoConsentManagerSDK/${VERSION}/OsanoConsentManagerSDK.podspec
66
80
sed -i '' "s|s.source = { :http => '<path-to-s3-zip>' }|s.source = { :http => '${URL}' }|" OsanoConsentManagerSDK/${VERSION}/OsanoConsentManagerSDK.podspec
@@ -74,25 +88,29 @@ jobs:
74
88
sed -i '' "s|checksum: .*|checksum: \"${CHECKSUM}\"|" Package.swift
75
89
working-directory : ${{ github.workspace }}
76
90
77
- - name : Install GitHub CLI
78
- run : |
79
- brew install gh
91
+ # - name: Install GitHub CLI
92
+ # run: |
93
+ # brew install gh
80
94
81
95
- name : Create branch and commit changes
82
96
run : |
83
- VERSION=${{ github.event.inputs.version }}
84
- BRANCH_NAME="update-osano-sdk-${VERSION}"
97
+ # VERSION=${{ github.event.inputs.version }}
98
+ VERSION="3.3.2"
99
+ BRANCH_NAME="update-osano-sdk-${VERSION}-test"
85
100
git config --global user.name 'Osano Automation'
86
101
git config --global user.email '[email protected] '
87
102
git checkout -b $BRANCH_NAME
88
103
git add .
89
104
git commit -m "Update OsanoConsentManagerSDK to version $VERSION"
90
105
git push origin $BRANCH_NAME
91
106
92
- - name : Create Pull Request
93
- run : |
94
- VERSION=${{ github.event.inputs.version }}
95
- BRANCH_NAME="update-osano-sdk-${VERSION}"
96
- gh pr create --title "Update OsanoConsentManagerSDK to version $VERSION" --body "This PR updates the OsanoConsentManagerSDK to version $VERSION." --head $BRANCH_NAME --base main
97
- env :
98
- GITHUB_TOKEN : ${{ secrets.OSANO_GITHUB_ACCESS_TOKEN }}
107
+ # - name: Create and push a new git tag
108
+ # run: |
109
+ # VERSION=${{ github.event.inputs.version }}
110
+ # git config --global user.email "Osano Automation"
111
+ # git config --global user.name "[email protected] "
112
+ # git tag -a "${VERSION}" -m "Release version ${VERSION}"
113
+ # git push origin "v${VERSION}"
114
+ # env:
115
+ # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116
+ # working-directory: ${{ github.workspace }}
0 commit comments