-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (42 loc) · 2.01 KB
/
create-no-bluetooth-flavor.yaml
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
name: Create no-bluetooth flavor for latest release
on:
workflow_dispatch:
release:
types: [released]
permissions:
contents: write
jobs:
create-flavor:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Swift
uses: swift-actions/setup-swift@v2
- name: Prepare Google Cast SDK
run: |
GOOGLE_CAST_SDK_URL=`cat Package.swift | perl -n -e'/let googleCastSdkUrl = "(.*)"/ && print $1'`
GOOGLE_CAST_SDK_NB_URL=`echo ${GOOGLE_CAST_SDK_URL} | sed 's/GoogleCastSDK-ios-/GoogleCastSDK-ios-no-bluetooth-/'`
echo "GOOGLE_CAST_SDK_URL=${GOOGLE_CAST_SDK_URL}" >>$GITHUB_ENV
echo "GOOGLE_CAST_SDK_NB_URL=${GOOGLE_CAST_SDK_NB_URL}" >>$GITHUB_ENV
GOOGLE_CAST_SDK_NB_DIR=$(mktemp -d)
curl -o ${GOOGLE_CAST_SDK_NB_DIR}/google-cast-sdk.zip ${GOOGLE_CAST_SDK_NB_URL}
GOOGLE_CAST_SDK_CHECKSUM=`cat Package.swift | perl -n -e'/let googleCastSdkChecksum = "(.*)"/ && print $1'`
GOOGLE_CAST_SDK_NB_CHECKSUM=`swift package compute-checksum ${GOOGLE_CAST_SDK_NB_DIR}/google-cast-sdk.zip`
echo "GOOGLE_CAST_SDK_CHECKSUM=${GOOGLE_CAST_SDK_CHECKSUM}" >>$GITHUB_ENV
echo "GOOGLE_CAST_SDK_NB_CHECKSUM=${GOOGLE_CAST_SDK_NB_CHECKSUM}" >>$GITHUB_ENV
- name: Substitute Google Cast SDK flavor
run: |
sed -i 's,${{ env.GOOGLE_CAST_SDK_URL }},${{ env.GOOGLE_CAST_SDK_NB_URL }},g' Package.swift
sed -i 's,${{ env.GOOGLE_CAST_SDK_CHECKSUM }},${{ env.GOOGLE_CAST_SDK_NB_CHECKSUM }},g' Package.swift
- name: Create new branch
run: |
RELEASE_VERSION=`git describe --abbrev=0 --tags`
git config user.name github-actions
git config user.email tech@bluebillywig.com
git checkout -b "${RELEASE_VERSION}-no-bluetooth" master
git add Package.swift
git commit -m "${RELEASE_VERSION}"
git push -u origin "${RELEASE_VERSION}-no-bluetooth"