Skip to content

Merge pull request #74 from Stremio/bump-ver #100

Merge pull request #74 from Stremio/bump-ver

Merge pull request #74 from Stremio/bump-ver #100

Workflow file for this run

# Copyright (C) 2017-2024 Smart Code OOD 203358507
name: MacOS Release
on:
push:
tags:
- 'v*'
jobs:
macos-release:
runs-on: macos-latest
env:
APP_IDENTITY: "FA18F75D76A5D513F8465C671CD0FE2F7F9AA848"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
- name: Node setup
uses: actions/setup-node@v4
with:
node-version: 16
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11.6'
- name: Utils
run: |
npm -g install appdmg
- name: Build
run: cargo build --release --features=bundled
- name: Bundle
run: |
cargo run --bin bundle-macos
- name: Setup keychain
run: |
security create-keychain -p stremioservice build.keychain
security default-keychain -s build.keychain
security set-keychain-settings build.keychain
security unlock-keychain -p stremioservice build.keychain
security import ./resources/certificates/developer_id_Installer.p12 -k build.keychain -P ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} -T /usr/bin/codesign
security import ./resources/certificates/developer_id_app.p12 -k build.keychain -P ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple: -s -k stremioservice build.keychain
security find-identity -v
- name: Sign app
run: |
codesign --deep --force --verbose --sign "$APP_IDENTITY" --entitlements ./resources/entitlements.plist --options runtime target/macos/StremioService.app
- name: Compress app
run: |
ditto -c -k --sequesterRsrc --keepParent target/macos/StremioService.app target/macos/StremioService.app.zip
- name: Notarize app
env:
NOTARIZATION_PWD: ${{ secrets.APPLE_DEVACCOUNT_NOTARIZATION_APP_SPECIFIC_PWD }}
TEAM_ID: ${{ secrets.TEAM_ID }}
run: |
echo "Create keychain profile"
xcrun notarytool store-credentials "notarytool-profile" --apple-id "[email protected]" --team-id "$TEAM_ID" --password "$NOTARIZATION_PWD"
echo "Notarize app"
xcrun notarytool submit target/macos/StremioService.app.zip --keychain-profile "notarytool-profile" --wait
echo Stapling the app...
xcrun stapler staple "target/macos/StremioService.app"
- name: Package
run: |
appdmg ./resources/appdmg.json "target/macos/StremioService.dmg"
- name: Sign DMG
run: |
codesign --deep --force --verbose --sign "$APP_IDENTITY" target/macos/StremioService.dmg
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-region: eu-west-1
- name: Upload to Amazon S3
run: |
aws s3 cp --acl public-read target/macos/StremioService.dmg s3://stremio-artifacts/stremio-service/${{ github.ref_name }}/
- name: Generate RC descriptor
run: |
node ./generate_descriptor.js --wait-all --tag=${{ github.ref_name }}
- name: Zip release for macos
uses: vimtor/[email protected]
with:
files: resources/bin/macos/ffmpeg resources/bin/macos/ffprobe resources/bin/macos/stremio-runtime target/release/stremio-service resources/bin/macos/server.js LICENSE.md
dest: stremio-service-macos.zip
- name: Get current date
id: date
run: echo "TODAY_DATE=$(date +'%d %b %Y')" >> $GITHUB_OUTPUT
- name: Upload dmg and zip file to release
uses: softprops/action-gh-release@v1
with:
# Use the same name as all releases!
name: Stremio Service ${{ github.ref_name }} (${{ steps.date.outputs.TODAY_DATE }})
draft: true
prerelease: false
fail_on_unmatched_files: true
files: |
target/macos/StremioService.dmg
stremio-service-macos.zip