-
Notifications
You must be signed in to change notification settings - Fork 126
executable file
·149 lines (127 loc) · 5.08 KB
/
shell.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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Shell
on:
push:
pull_request:
schedule:
- cron: '15 21 * * *'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest]
# node: ['8']
env:
APP_IDENTITY: "FA18F75D76A5D513F8465C671CD0FE2F7F9AA848"
CERT_PASS: ${{ secrets.CERT_PASS }}
DEST_DIR: ./build/stremio.app/Contents/MacOS
TAG: master
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
steps:
#- uses: maxim-lobanov/[email protected]
# with:
# xcode-version: '11.5'
- uses: actions/checkout@v2
# - uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node }}
- name: Submodules
run: git submodule update --init --recursive
- name: Prepare environment
run: |
SHELL_VERSION=$(./dist-utils/common/get-version.sh)
DMG_PATH="Stremio $SHELL_VERSION.dmg"
node -e 'process.stdout.write("CURRENT_BRANCH="+process.env.GITHUB_REF.replace(/^refs\/(heads|tags)\//, "")+"\n")' >> $GITHUB_ENV
echo SHELL_VERSION=$SHELL_VERSION >> $GITHUB_ENV
echo DMG_PATH=$DMG_PATH >> $GITHUB_ENV
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then echo DEPLOY=false >> $GITHUB_ENV; else echo DEPLOY=true >> $GITHUB_ENV; fi
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: 5.15.2
modules: qtwebengine qtwebglplugin
- name: Dependencies
run: |
brew update-reset
brew update
brew install openssl
npm -g install appdmg
- name: Build
run: |
git clone https://github.com/iina/iina
bash ./iina/other/download_libs.sh
export MPV_BIN_PATH=$(pwd)/deps
( cd $MPV_BIN_PATH/lib && ln -s libmpv.2.dylib libmpv.dylib )
export OPENSSL_BIN_PATH=$(brew --prefix openssl)
mkdir build
( cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_RULE_MESSAGES:BOOL=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON .. && make --no-print-directory )
- name: Add binaries
run: |
cp ./mac/ffmpeg $DEST_DIR/
cp ./mac/ffprobe $DEST_DIR/
cat ./mac/node > $DEST_DIR/node
chmod +w $DEST_DIR/ffmpeg
chmod +w $DEST_DIR/ffprobe
chmod +wx $DEST_DIR/node
- name: Deploy
run: |
macdeployqt ./build/stremio.app -executable=$DEST_DIR/ffmpeg -executable=$DEST_DIR/ffprobe -executable=$DEST_DIR/node
- name: Server
env:
TAG: master
run: |
curl $(cat ./server-url.txt) > $DEST_DIR/server.js
- name: Fix dependencies
run: |
cp ./deps/lib/* ./build/stremio.app/Contents/Frameworks
cp ./mac/libcrypto.3.dylib ./build/stremio.app/Contents/Frameworks
- name: Testdrive
run: ( $DEST_DIR/stremio & sleep 10 && STREMIO_PID=$! && kill $STREMIO_PID )
- name: Rename the app
run: mv ./build/stremio.app ./Stremio.app
- name: Setup keychain
run: if [ "$DEPLOY" = "true" ]; then source ./mac/keychain_profile; fi
- name: Sign App
run: |
if [ "$DEPLOY" = "true" ]; then codesign --deep --force -v -s $APP_IDENTITY --entitlements ./mac/entitlements.plist --options runtime ./Stremio.app; fi
- name: Notarizing
env:
NOTARIZATION_PWD: ${{ secrets.NOTARIZATION_PWD }}
TEAM_ID: ${{ secrets.TEAM_ID }}
run: |
if [ "$DEPLOY" = "true" ]; then ./mac/notarizer.sh Stremio.app "[email protected]" "$NOTARIZATION_PWD" "$TEAM_ID"; fi
- name: Pack
run: |
ditto -c -k --rsrc --keepParent Stremio.app Stremio.app.zip
sed -ie 's/"title": "Stremio.*"/"title": "Stremio '$SHELL_VERSION'"/' ./mac/appdmg.json
appdmg ./mac/appdmg.json "$DMG_PATH"
- name: Sign Dmg
run: |
if [ "$DEPLOY" = "true" ]; then codesign --deep --force -v -s $APP_IDENTITY "$DMG_PATH"; fi
- name: Store DMG
uses: actions/upload-artifact@v1
with:
name: StremioDMG
path: "${{ env.DMG_PATH }}"
- name: Upload to AWS
shell: bash
env:
AWS_ACCESS_KEY_ID: AKIAJWBFLU34IVITPLHA
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET }}
AWS_DEFAULT_REGION: eu-west-1
run: |
pip3 install s3cmd
if [ "$DEPLOY" = "true" ]; then s3cmd --acl-public --access_key=$AWS_ACCESS_KEY_ID --secret_key=$AWS_SECRET_ACCESS_KEY --force --region=$AWS_DEFAULT_REGION put "$DMG_PATH" s3://stremio-artifacts/shell-osx/$CURRENT_BRANCH/ ; fi
slackNotification:
name: Slack Notification
runs-on: ubuntu-latest
steps:
- name: Notify Slack channel
uses: rtCamp/action-slack-notify@master
env:
SLACK_USERNAME: Github Action
SLACK_ICON: https://s3-us-west-2.amazonaws.com/slack-files2/bot_icons/2020-10-19/1422366829703_48.png
SLACK_TITLE: Github Builds - Shell
SLACK_CHANNEL: '#installer-ci'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
if: ${{ !github.event.pull_request }}