Skip to content

Commit

Permalink
Merge branch 'release/late-04-2024'
Browse files Browse the repository at this point in the history
  • Loading branch information
rts-devops committed Apr 29, 2024
2 parents 9974180 + 7b38efb commit 1c8d6ec
Show file tree
Hide file tree
Showing 89 changed files with 1,398 additions and 163 deletions.
1 change: 0 additions & 1 deletion .github/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
changelog:
exclude:
authors:
Expand Down
118 changes: 118 additions & 0 deletions .github/workflows/pr-closure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Deployments after PR closure

on:
pull_request:
types: [closed]

jobs:
update-deployment:
runs-on: ubuntu-latest
permissions:
deployments: write

steps:
- name: Update deployment statuses to Inactive
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
AUTHORIZATION="Authorization: token $GITHUB_TOKEN"
ACCEPT="Accept: application/vnd.github.ant-man-preview+json"
PR_URL="https://api.github.com/repos/$GITHUB_REPOSITORY/pulls/$GITHUB_PR_NUMBER"
DEPLOYMENTS_URL="https://api.github.com/repos/$GITHUB_REPOSITORY/deployments"
echo "Working with PR URL: $PR_URL"
# Get the pull request head branch
HEAD_BRANCH=$(curl -s -H "$AUTHORIZATION" "$PR_URL" | jq -r '.head.ref')
if [ "$HEAD_BRANCH" == "null" ]; then
echo "No PR available, so no founded environments. Exiting..."
exit 0
fi
# Get the pull request state
PR_STATE=$(curl -s -H "$AUTHORIZATION" "$PR_URL" | jq -r '.state')
if [ "$PR_STATE" != "closed" ]; then
echo "PR not closed. Exiting..."
exit 0
fi
# Remove "feature/" from the head branch
BUILD_NAME=$(echo "$HEAD_BRANCH" | sed 's/feature\///g')
# Define environment names
IOS_ENVIRONMENT=$(echo "playsrg-ios-nightly+$BUILD_NAME" | jq -R -r @uri)
TVOS_ENVIRONMENT=$(echo "playsrg-tvos-nightly+$BUILD_NAME" | jq -R -r @uri)
echo "Working with iOS environment: $IOS_ENVIRONMENT"
echo "Working with tvOS environment: $TVOS_ENVIRONMENT"
# Get the latest active deployment for iOS
IOS_DEPLOYMENT=$(curl -s -H "$AUTHORIZATION" "$DEPLOYMENTS_URL?environment=$IOS_ENVIRONMENT" | jq '.[0]')
# Get the latest active deployment for tvOS
TVOS_DEPLOYMENT=$(curl -s -H "$AUTHORIZATION" "$DEPLOYMENTS_URL?environment=$TVOS_ENVIRONMENT" | jq '.[0]')
# Function to fetch log and environment URLs from status URL
fetch_status_urls() {
STATUS_URL=$1
STATUS_RESPONSE=$(curl -s -H "$AUTHORIZATION" "$STATUS_URL")
FIRST_STATUS=$(echo "$STATUS_RESPONSE" | jq -r '.[0]')
LOG_URL=$(echo "$FIRST_STATUS" | jq -r '.log_url')
ENVIRONMENT_URL=$(echo "$FIRST_STATUS" | jq -r '.environment_url')
echo "$LOG_URL,$ENVIRONMENT_URL"
}
if [ "$IOS_DEPLOYMENT" != "null" ]; then
DEPLOYMENT_ID=$(echo "$IOS_DEPLOYMENT" | jq -r '.id')
STATUSES_URL=$(echo "$IOS_DEPLOYMENT" | jq -r '.statuses_url')
echo "Working with iOS deployment ID: $DEPLOYMENT_ID"
URLS=$(fetch_status_urls "$STATUSES_URL")
IFS=',' read -r LOG_URL ENVIRONMENT_URL <<< "$URLS"
# Mark the latest deployment for iOS nightly as inactive
DEPLOYMENT_URL="$DEPLOYMENTS_URL/$DEPLOYMENT_ID/statuses"
BODY="{\"state\": \"inactive\", \"description\": \"The PR is closed.\", \
\"log_url\": \"$LOG_URL\", \"environment_url\": \"$ENVIRONMENT_URL\"}"
RESPONSE=$(curl -s -X POST -H "$AUTHORIZATION" -H "$ACCEPT" "$DEPLOYMENT_URL" -d "$BODY")
# Extract information from the response
RESPONSE_STATE=$(echo "$RESPONSE" | jq -r '.state')
RESPONSE_ENVIRONMENT=$(echo "$RESPONSE" | jq -r '.environment')
# Output the information
echo "-> Update $RESPONSE_ENVIRONMENT latest deployment to $RESPONSE_STATE state."
else
IOS_ENVIRONMENT=$(printf '%b' "${IOS_ENVIRONMENT//%/\\x}")
echo "-> No deployment for $IOS_ENVIRONMENT environment. No update."
fi
if [ "$TVOS_DEPLOYMENT" != "null" ]; then
DEPLOYMENT_ID=$(echo "$TVOS_DEPLOYMENT" | jq -r '.id')
STATUSES_URL=$(echo "$TVOS_DEPLOYMENT" | jq -r '.statuses_url')
echo "Working with tvOS deployment ID: $DEPLOYMENT_ID"
URLS=$(fetch_status_urls "$STATUSES_URL")
IFS=',' read -r LOG_URL ENVIRONMENT_URL <<< "$URLS"
# Mark the latest deployment for tvOS nightly as inactive
DEPLOYMENT_URL="$DEPLOYMENTS_URL/$DEPLOYMENT_ID/statuses"
BODY="{\"state\": \"inactive\", \"description\": \"The PR is closed.\", \
\"log_url\": \"$LOG_URL\", \"environment_url\": \"$ENVIRONMENT_URL\"}"
RESPONSE=$(curl -s -X POST -H "$AUTHORIZATION" -H "$ACCEPT" "$DEPLOYMENT_URL" -d "$BODY")
# Extract information from the response
RESPONSE_STATE=$(echo "$RESPONSE" | jq -r '.state')
RESPONSE_ENVIRONMENT=$(echo "$RESPONSE" | jq -r '.environment')
# Output the information
echo "-> Update $RESPONSE_ENVIRONMENT latest deployment to $RESPONSE_STATE state."
else
TVOS_ENVIRONMENT=$(printf '%b' "${TVOS_ENVIRONMENT//%/\\x}")
echo "-> No deployment for $TVOS_ENVIRONMENT environment. No update."
fi
17 changes: 17 additions & 0 deletions .jira/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
deployments:
environmentMapping:
testing:
- "playsrg-ios-nightly*"
- "playsrg-tvos-nightly*"
- "playsrg-ios-beta+*"
- "playsrg-tvos-beta+*"
- "playsrg-ios-testflight+*"
- "playsrg-tvos-testflight+*"
staging:
- "playsrg-ios-beta"
- "playsrg-tvos-beta"
- "playsrg-ios-testflight"
- "playsrg-tvos-testflight"
production:
- "playsrg-ios-appstore*"
- "playsrg-tvos-appstore*"
1 change: 0 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
inherit_mode:
merge:
- Include
Expand Down
1 change: 0 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
included:
- Application
- Common
Expand Down
3 changes: 3 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rules:
line-length:
max: 120
27 changes: 27 additions & 0 deletions Application/Resources/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
<string>1C8F.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>85F4.1</string>
<string>E174.1</string>
</array>
</dict>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -103,53 +103,53 @@ body:
version: 2.0.1

name: abseil-cpp-binary, nameSpecified: abseil, owner: google, version: 1.2022062300.0, source: https://github.com/google/abseil-cpp-binary
name: abseil-cpp-binary, nameSpecified: abseil, owner: google, version: 1.2024011601.0, source: https://github.com/google/abseil-cpp-binary

name: Aiolos, nameSpecified: Aiolos, owner: IdeasOnCanvas, version: 1.9.8, source: https://github.com/IdeasOnCanvas/Aiolos

name: app-check, nameSpecified: AppCheck, owner: google, version: 10.18.0, source: https://github.com/google/app-check
name: app-check, nameSpecified: AppCheck, owner: google, version: 10.18.1, source: https://github.com/google/app-check

name: appcenter-sdk-apple, nameSpecified: AppCenter, owner: microsoft, version: 5.0.4, source: https://github.com/microsoft/appcenter-sdk-apple

name: Comscore-Swift-Package-Manager, nameSpecified: Comscore-Swift-Package-Manager, owner: comScore, version: 6.11.0, source: https://github.com/comScore/Comscore-Swift-Package-Manager

name: DZNEmptyDataSet, nameSpecified: DZNEmptyDataSet, owner: dzenbot, version: , source: https://github.com/dzenbot/DZNEmptyDataSet

name: firebase-ios-sdk, nameSpecified: Firebase, owner: firebase, version: 10.19.1, source: https://github.com/firebase/firebase-ios-sdk
name: firebase-ios-sdk, nameSpecified: Firebase, owner: firebase, version: 10.23.1, source: https://github.com/firebase/firebase-ios-sdk

name: FSCalendar, nameSpecified: FSCalendar, owner: WenchaoD, version: 2.8.4, source: https://github.com/WenchaoD/FSCalendar

name: FXReachability, nameSpecified: FXReachability, owner: SRGSSR, version: 1.3.2-srg6, source: https://github.com/SRGSSR/FXReachability

name: Gifu, nameSpecified: Gifu, owner: kaishin, version: 3.4.1, source: https://github.com/kaishin/Gifu

name: GoogleAppMeasurement, nameSpecified: GoogleAppMeasurement, owner: google, version: 10.17.0, source: https://github.com/google/GoogleAppMeasurement
name: GoogleAppMeasurement, nameSpecified: GoogleAppMeasurement, owner: google, version: 10.23.1, source: https://github.com/google/GoogleAppMeasurement

name: GoogleCastSDK-no-bluetooth, nameSpecified: GoogleCastSDK-no-bluetooth, owner: SRGSSR, version: 4.8.0, source: https://github.com/SRGSSR/GoogleCastSDK-no-bluetooth

name: GoogleDataTransport, nameSpecified: GoogleDataTransport, owner: google, version: 9.3.0, source: https://github.com/google/GoogleDataTransport
name: GoogleDataTransport, nameSpecified: GoogleDataTransport, owner: google, version: 9.4.0, source: https://github.com/google/GoogleDataTransport

name: GoogleUtilities, nameSpecified: GoogleUtilities, owner: google, version: 7.12.1, source: https://github.com/google/GoogleUtilities
name: GoogleUtilities, nameSpecified: GoogleUtilities, owner: google, version: 7.13.1, source: https://github.com/google/GoogleUtilities

name: grpc-binary, nameSpecified: gRPC, owner: google, version: 1.49.1, source: https://github.com/google/grpc-binary
name: grpc-binary, nameSpecified: gRPC, owner: google, version: 1.62.1, source: https://github.com/google/grpc-binary

name: gtm-session-fetcher, nameSpecified: gtm-session-fetcher, owner: google, version: 3.2.0, source: https://github.com/google/gtm-session-fetcher
name: gtm-session-fetcher, nameSpecified: gtm-session-fetcher, owner: google, version: 3.3.2, source: https://github.com/google/gtm-session-fetcher

name: interop-ios-for-google-sdks, nameSpecified: InteropForGoogle, owner: google, version: 100.0.0, source: https://github.com/google/interop-ios-for-google-sdks

name: ios-library, nameSpecified: Airship, owner: urbanairship, version: 16.12.5, source: https://github.com/urbanairship/ios-library
name: ios-library, nameSpecified: Airship, owner: urbanairship, version: 16.12.6, source: https://github.com/urbanairship/ios-library

name: iOSV5, nameSpecified: TagCommander SDK V5, owner: CommandersAct, version: 5.4.4, source: https://github.com/CommandersAct/iOSV5
name: iOSV5, nameSpecified: TagCommander SDK V5, owner: CommandersAct, version: 5.4.6, source: https://github.com/CommandersAct/iOSV5

name: leveldb, nameSpecified: leveldb, owner: firebase, version: 1.22.3, source: https://github.com/firebase/leveldb
name: leveldb, nameSpecified: leveldb, owner: firebase, version: 1.22.4, source: https://github.com/firebase/leveldb

name: libextobjc, nameSpecified: libextobjc, owner: SRGSSR, version: 0.6.0-srg4, source: https://github.com/SRGSSR/libextobjc

name: MAKVONotificationCenter, nameSpecified: MAKVONotificationCenter, owner: SRGSSR, version: 1.0.0-srg6, source: https://github.com/SRGSSR/MAKVONotificationCenter

name: Mantle, nameSpecified: Mantle, owner: Mantle, version: 2.2.0, source: https://github.com/Mantle/Mantle

name: nanopb, nameSpecified: nanopb, owner: firebase, version: 2.30909.0, source: https://github.com/firebase/nanopb
name: nanopb, nameSpecified: nanopb, owner: firebase, version: 2.30910.0, source: https://github.com/firebase/nanopb

name: Nuke, nameSpecified: Nuke, owner: kean, version: 10.11.2, source: https://github.com/kean/Nuke

Expand All @@ -159,15 +159,15 @@ name: paper-onboarding, nameSpecified: PaperOnboarding, owner: Ramotion, version

name: PLCrashReporter, nameSpecified: PLCrashReporter, owner: microsoft, version: 1.11.1, source: https://github.com/microsoft/PLCrashReporter

name: promises, nameSpecified: Promises, owner: google, version: 2.3.1, source: https://github.com/google/promises
name: promises, nameSpecified: Promises, owner: google, version: 2.4.0, source: https://github.com/google/promises

name: srganalytics-apple, nameSpecified: SRGAnalytics, owner: SRGSSR, version: 9.1.0, source: https://github.com/SRGSSR/srganalytics-apple

name: srgappearance-apple, nameSpecified: SRGAppearance, owner: SRGSSR, version: 5.2.1, source: https://github.com/SRGSSR/srgappearance-apple

name: srgcontentprotection-apple, nameSpecified: SRGContentProtection, owner: SRGSSR, version: 3.1.0, source: https://github.com/SRGSSR/srgcontentprotection-apple

name: srgdataprovider-apple, nameSpecified: SRGDataProvider, owner: SRGSSR, version: 19.0.1, source: https://github.com/SRGSSR/srgdataprovider-apple
name: srgdataprovider-apple, nameSpecified: SRGDataProvider, owner: SRGSSR, version: 19.0.2, source: https://github.com/SRGSSR/srgdataprovider-apple

name: srgdiagnostics-apple, nameSpecified: SRGDiagnostics, owner: SRGSSR, version: 3.1.0, source: https://github.com/SRGSSR/srgdiagnostics-apple

Expand All @@ -183,9 +183,9 @@ name: srgnetwork-apple, nameSpecified: SRGNetwork, owner: SRGSSR, version: 3.1.0

name: srguserdata-apple, nameSpecified: SRGUserData, owner: SRGSSR, version: 3.3.1, source: https://github.com/SRGSSR/srguserdata-apple

name: swift-collections, nameSpecified: swift-collections, owner: apple, version: 1.0.6, source: https://github.com/apple/swift-collections
name: swift-collections, nameSpecified: swift-collections, owner: apple, version: 1.1.0, source: https://github.com/apple/swift-collections

name: swift-protobuf, nameSpecified: SwiftProtobuf, owner: apple, version: 1.25.2, source: https://github.com/apple/swift-protobuf
name: swift-protobuf, nameSpecified: SwiftProtobuf, owner: apple, version: 1.26.0, source: https://github.com/apple/swift-protobuf

name: SwiftMessages, nameSpecified: SwiftMessages, owner: SwiftKickMobile, version: 9.0.9, source: https://github.com/SwiftKickMobile/SwiftMessages

Expand Down
Loading

0 comments on commit 1c8d6ec

Please sign in to comment.