Skip to content

Shell

Shell #1760

Workflow file for this run

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 }}