Browse Source

first pass at native macos app

pull/600/head
Jason Dove 4 years ago
parent
commit
de9af2f0f6
  1. 160
      .github/workflows/artifacts.yml
  2. 3
      .gitmodules
  3. 1
      ErsatzTV-macOS
  4. 26
      scripts/macOS/Info.plist
  5. 14
      scripts/macOS/bundle.sh
  6. 9
      scripts/macOS/launcher.sh

160
.github/workflows/artifacts.yml

@ -36,9 +36,9 @@ jobs: @@ -36,9 +36,9 @@ jobs:
- os: macos-latest
kind: macOS
target: osx-x64
- os: macos-latest
kind: macOS
target: osx-arm64
# - os: macos-latest
# kind: macOS
# target: osx-arm64
steps:
- name: Get the sources
uses: actions/checkout@v2
@ -75,8 +75,8 @@ jobs: @@ -75,8 +75,8 @@ jobs:
- name: Bundle
shell: bash
run: |
plutil -replace CFBundleShortVersionString -string "${{ inputs.info_version }}" scripts/macOS/Info.plist
plutil -replace CFBundleVersion -string "${{ inputs.info_version }}" scripts/macOS/Info.plist
plutil -replace CFBundleShortVersionString -string "${{ inputs.info_version }}" ErsatzTV-macOS/ErsatzTV-macOS/Info.plist
plutil -replace CFBundleVersion -string "${{ inputs.info_version }}" ErsatzTV-macOS/ErsatzTV-macOS/Info.plist
scripts/macOS/bundle.sh
- name: Sign
@ -134,78 +134,78 @@ jobs: @@ -134,78 +134,78 @@ jobs:
${{ env.RELEASE_NAME }}.dmg
env:
GITHUB_TOKEN: ${{ secrets.gh_token }}
build_and_upload:
name: Build & Upload
runs-on: ${{ matrix.os }}
if: contains(github.event.head_commit.message, '[no build]') == false
strategy:
matrix:
include:
- os: ubuntu-latest
kind: linux
target: linux-x64
- os: ubuntu-latest
kind: linux
target: linux-arm
- os: windows-latest
kind: windows
target: win-x64
steps:
- name: Get the sources
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Clean
run: dotnet clean --configuration Release && dotnet nuget locals all --clear
- name: Install dependencies
run: dotnet restore -r "${{ matrix.target}}"
- name: Build
shell: bash
run: |
# Define some variables for things we need
release_name="ErsatzTV-${{ inputs.release_version }}-${{ matrix.target }}"
echo "RELEASE_NAME=${release_name}" >> $GITHUB_ENV
# Build everything
dotnet publish ErsatzTV/ErsatzTV.csproj --framework net6.0 --runtime "${{ matrix.target }}" -c Release -o "$release_name" -p:InformationalVersion="${{ inputs.release_version }}-${{ matrix.target }}" -p:EnableCompressionInSingleFile=true -p:DebugType=Embedded -p:PublishSingleFile=true --self-contained true
# Pack files
if [ "${{ matrix.kind }}" == "windows" ]; then
7z a -tzip "${release_name}.zip" "./${release_name}/*"
else
tar czvf "${release_name}.tar.gz" "$release_name"
fi
# Delete output directory
rm -r "$release_name"
env:
AC_USERNAME: ${{ secrets.ac_username }}
AC_PASSWORD: ${{ secrets.ac_password }}
- name: Delete old release assets
uses: mknejp/delete-release-assets@v1
with:
token: ${{ secrets.gh_token }}
tag: ${{ inputs.release_tag }}
fail-if-no-assets: false
assets: |
*${{ matrix.target }}.zip
*${{ matrix.target }}.tar.gz
- name: Publish
uses: softprops/action-gh-release@v1
with:
prerelease: true
tag_name: ${{ inputs.release_tag }}
files: |
${{ env.RELEASE_NAME }}.zip
${{ env.RELEASE_NAME }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.gh_token }}
# build_and_upload:
# name: Build & Upload
# runs-on: ${{ matrix.os }}
# if: contains(github.event.head_commit.message, '[no build]') == false
# strategy:
# matrix:
# include:
# - os: ubuntu-latest
# kind: linux
# target: linux-x64
# - os: ubuntu-latest
# kind: linux
# target: linux-arm
# - os: windows-latest
# kind: windows
# target: win-x64
# steps:
# - name: Get the sources
# uses: actions/checkout@v2
# with:
# fetch-depth: 0
#
# - name: Setup .NET Core
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: 6.0.x
#
# - name: Clean
# run: dotnet clean --configuration Release && dotnet nuget locals all --clear
#
# - name: Install dependencies
# run: dotnet restore -r "${{ matrix.target}}"
#
# - name: Build
# shell: bash
# run: |
# # Define some variables for things we need
# release_name="ErsatzTV-${{ inputs.release_version }}-${{ matrix.target }}"
# echo "RELEASE_NAME=${release_name}" >> $GITHUB_ENV
#
# # Build everything
# dotnet publish ErsatzTV/ErsatzTV.csproj --framework net6.0 --runtime "${{ matrix.target }}" -c Release -o "$release_name" -p:InformationalVersion="${{ inputs.release_version }}-${{ matrix.target }}" -p:EnableCompressionInSingleFile=true -p:DebugType=Embedded -p:PublishSingleFile=true --self-contained true
#
# # Pack files
# if [ "${{ matrix.kind }}" == "windows" ]; then
# 7z a -tzip "${release_name}.zip" "./${release_name}/*"
# else
# tar czvf "${release_name}.tar.gz" "$release_name"
# fi
#
# # Delete output directory
# rm -r "$release_name"
# env:
# AC_USERNAME: ${{ secrets.ac_username }}
# AC_PASSWORD: ${{ secrets.ac_password }}
#
# - name: Delete old release assets
# uses: mknejp/delete-release-assets@v1
# with:
# token: ${{ secrets.gh_token }}
# tag: ${{ inputs.release_tag }}
# fail-if-no-assets: false
# assets: |
# *${{ matrix.target }}.zip
# *${{ matrix.target }}.tar.gz
# - name: Publish
# uses: softprops/action-gh-release@v1
# with:
# prerelease: true
# tag_name: ${{ inputs.release_tag }}
# files: |
# ${{ env.RELEASE_NAME }}.zip
# ${{ env.RELEASE_NAME }}.tar.gz
# env:
# GITHUB_TOKEN: ${{ secrets.gh_token }}

3
.gitmodules vendored

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
[submodule "ErsatzTV-macOS"]
path = ErsatzTV-macOS
url = git@github.com:jasongdove/ErsatzTV-macOS.git

1
ErsatzTV-macOS

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit 94013ad5b6b80b694281398027cd67beea77500a

26
scripts/macOS/Info.plist

@ -1,26 +0,0 @@ @@ -1,26 +0,0 @@
<?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>CFBundleDisplayName</key>
<string>ErsatzTV</string>
<key>CFBundleExecutable</key>
<string>launcher.sh</string>
<key>CFBundleIconFile</key>
<string>ErsatzTV.icns</string>
<key>CFBundleIdentifier</key>
<string>com.jasongdove.ersatztv</string>
<key>CFBundleName</key>
<string>ErsatzTV</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.3.7-alpha</string>
<key>CFBundleVersion</key>
<string>0.3.7-alpha</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

14
scripts/macOS/bundle.sh

@ -5,22 +5,14 @@ REPO_ROOT="$SCRIPT_FOLDER/../.." @@ -5,22 +5,14 @@ REPO_ROOT="$SCRIPT_FOLDER/../.."
APP_NAME="$REPO_ROOT/ErsatzTV.app"
PUBLISH_OUTPUT_DIRECTORY="$REPO_ROOT/publish/."
INFO_PLIST="$SCRIPT_FOLDER/Info.plist"
ICON_SOURCE="$REPO_ROOT/artwork/ErsatzTV.icns"
ICON_FILE="ErsatzTV.icns"
if [ -d "$APP_NAME" ]
then
rm -rf "$APP_NAME"
fi
mkdir "$APP_NAME"
cd "$REPO_ROOT/ErsatzTV-macOS" || exit
xcodebuild build
cp -R "$REPO_ROOT/ErsatzTV-macOS/build/Release/ErsatzTV-macOS.app" "$APP_NAME"
mkdir "$APP_NAME/Contents"
mkdir "$APP_NAME/Contents/MacOS"
mkdir "$APP_NAME/Contents/Resources"
cp "$INFO_PLIST" "$APP_NAME/Contents/Info.plist"
cp "$ICON_SOURCE" "$APP_NAME/Contents/Resources/$ICON_FILE"
cp -a "$PUBLISH_OUTPUT_DIRECTORY" "$APP_NAME/Contents/MacOS"
cp "$SCRIPT_FOLDER/launcher.sh" "$APP_NAME/Contents/MacOS/"

9
scripts/macOS/launcher.sh

@ -1,9 +0,0 @@ @@ -1,9 +0,0 @@
#! /bin/sh
# Set the working directory
DIR=$(cd "$(dirname "$0")"; pwd)
# Run the application
echo "running from $DIR"
open -a Terminal $DIR/ErsatzTV
Loading…
Cancel
Save