Skip to content

Commit

Permalink
Add Macos arm64 binary (#901)
Browse files Browse the repository at this point in the history
* Create MacOSArm64 publish profile for TwitchDownloaderClI

* Update README

* Update workflows

* Missed a line

* That's what I get for copy-pasting
  • Loading branch information
ScrubN authored Dec 15, 2023
1 parent 72ca1ac commit 1c5a402
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 14 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,29 @@ jobs:
run: dotnet restore TwitchDownloaderCLI
- name: Build MacOS CLI
run: dotnet publish TwitchDownloaderCLI -p:PublishProfile=MacOS -p:DebugType=None -p:DebugSymbols=false

- name: Build MacOSArm64 CLI
run: dotnet publish TwitchDownloaderCLI -p:PublishProfile=MacOSArm64 -p:DebugType=None -p:DebugSymbols=false

- name: Zip MacOS CLI
uses: vimtor/action-zip@v1
with:
files: "TwitchDownloaderCLI/bin/Release/net6.0/publish/MacOS"
dest: TwitchDownloaderCLI-MacOS-x64.zip

- name: Zip MacOSArm64 CLI
uses: vimtor/action-zip@v1
with:
files: "TwitchDownloaderCLI/bin/Release/net6.0/publish/MacOSArm64"
dest: TwitchDownloaderCLI-MacOSArm64.zip

- name: Upload MacOS CLI Artifact Asset
uses: actions/upload-artifact@v3
with:
name: TwitchDownloaderCLI-MacOS-x64.zip
path: TwitchDownloaderCLI-MacOS-x64.zip


- name: Upload MacOSArm64 CLI Artifact Asset
uses: actions/upload-artifact@v3
with:
name: TwitchDownloaderCLI-MacOSArm64.zip
path: TwitchDownloaderCLI-MacOSArm64.zip
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,20 @@ jobs:
run: dotnet restore TwitchDownloaderCLI
- name: Build MacOS CLI
run: dotnet publish TwitchDownloaderCLI -p:PublishProfile=MacOS -p:DebugType=None -p:DebugSymbols=false
- name: Build MacOSArm64 CLI
run: dotnet publish TwitchDownloaderCLI -p:PublishProfile=MacOSArm64 -p:DebugType=None -p:DebugSymbols=false

- name: Zip MacOS CLI
uses: vimtor/action-zip@v1
with:
files: "TwitchDownloaderCLI/bin/Release/net6.0/publish/MacOS"
dest: TwitchDownloaderCLI-${{ github.event.inputs.release_tag }}-MacOS-x64.zip

- name: Zip MacOSArm64 CLI
uses: vimtor/action-zip@v1
with:
files: "TwitchDownloaderCLI/bin/Release/net6.0/publish/MacOSArm64"
dest: TwitchDownloaderCLI-${{ github.event.inputs.release_tag }}-MacOSArm64.zip

- name: Download URL
uses: actions/download-artifact@v2
Expand All @@ -243,3 +251,13 @@ jobs:
asset_path: TwitchDownloaderCLI-${{ github.event.inputs.release_tag }}-MacOS-x64.zip
asset_name: TwitchDownloaderCLI-${{ github.event.inputs.release_tag }}-MacOS-x64.zip
asset_content_type: application/zip

- name: Upload MacOSArm64 CLI Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.url.outputs.content }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: TwitchDownloaderCLI-${{ github.event.inputs.release_tag }}-MacOSArm64.zip
asset_name: TwitchDownloaderCLI-${{ github.event.inputs.release_tag }}-MacOSArm64.zip
asset_content_type: application/zip
39 changes: 27 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ TwitchDownloaderCLI.exe chatrender -i %vodid%_chat.json -h 1080 -w 422 --framera

1. Go to [Releases](https://github.com/lay295/TwitchDownloader/releases/) and download the latest version for Windows or [build from source](#building-from-source).
2. Extract `TwitchDownloaderCLI.exe`.
3. Browse to where you extracted the file in the terminal.
3. Browse to where you extracted the executable:
```
cd C:\folder\containing\TwitchDownloaderCLI
```
4. If you do not have FFmpeg, you can install it via [Chocolatey package manager](https://community.chocolatey.org/), or you can get it as a standalone file from [ffmpeg.org](https://ffmpeg.org/download.html) or by using TwitchDownloaderCLI:
```
TwitchDownloaderCLI.exe ffmpeg --download
Expand All @@ -103,39 +106,51 @@ TwitchDownloaderCLI.exe videodownload --id <vod-id-here> -o out.mp4
2. Ensure both `fontconfig` and `libfontconfig1` are installed. `apt-get install fontconfig libfontconfig1` on Ubuntu.
3. Go to [Releases](https://github.com/lay295/TwitchDownloader/releases/) and download the latest binary for Linux, grab the [AUR Package](https://aur.archlinux.org/packages/twitch-downloader-bin/) for Arch Linux, or [build from source](#building-from-source).
4. Extract `TwitchDownloaderCLI`.
5. Browse to where you extracted the file and give it executable rights in the terminal:
5. Browse to where you extracted the binary:
```
cd directory/containing/TwitchDownloaderCLI
```
6. Give the binary executable rights:
```
sudo chmod +x TwitchDownloaderCLI
```
6. a) If you do not have FFmpeg, you should install it via your distro package manager, however you can also get it as a standalone file from [ffmpeg.org](https://ffmpeg.org/download.html) or by using TwitchDownloaderCLI:
7. a) If you do not have FFmpeg, you should install it system-wide via your distro package manager, however you can also get it as a standalone file from [ffmpeg.org](https://ffmpeg.org/download.html) or by using TwitchDownloaderCLI:
```
./TwitchDownloaderCLI ffmpeg --download
```
6. b) If downloaded as a standalone file, you must also give it executable rights with:
7. b) If downloaded as a standalone file, you must also give it executable rights with:
```
sudo chmod +x ffmpeg
```
7. You can now start using the downloader, for example:
8. You can now start using the downloader, for example:
```
./TwitchDownloaderCLI videodownload --id <vod-id-here> -o out.mp4
```

## MacOS – Getting started
1. Go to [Releases](https://github.com/lay295/TwitchDownloader/releases/) and download the latest binary for MacOS or [build from source](#building-from-source).
2. Extract `TwitchDownloaderCLI`.
3. Browse to where you extracted the file and give it executable rights in the terminal:
1. If your device has an Apple Silicon M-series processor, ensure that you download the arm64 binary, however if you would like to use the x64 binary on Apple Silicon it must be run via a terminal session running under Rosetta 2:
```
arch -x86_64 zsh
```
2. Go to [Releases](https://github.com/lay295/TwitchDownloader/releases/) and download the latest binary for MacOS or [build from source](#building-from-source).
3. Extract `TwitchDownloaderCLI`.
4. Browse to where you extracted the binary:
```
cd directory/containing/TwitchDownloaderCLI
```
5. Give the binary executable rights in the terminal:
```
chmod +x TwitchDownloaderCLI
```
4. a) If you do not have FFmpeg, you can install it via [Homebrew package manager](https://brew.sh/), or you can get it as a standalone file from [ffmpeg.org](https://ffmpeg.org/download.html) or by using TwitchDownloaderCLI:
6. a) If you do not have FFmpeg, you can install it system-wide via the [Homebrew package manager](https://brew.sh/), or you can get it as a standalone file from [ffmpeg.org](https://ffmpeg.org/download.html) or by using TwitchDownloaderCLI:
```
./TwitchDownloaderCLI ffmpeg --download
```
4. b) If downloaded as a standalone file, you must also give it executable rights with:
6. b) If downloaded as a standalone file, you must also give it executable rights with:
```
chmod +x ffmpeg
```
5. You can now start using the downloader, for example:
7. You can now start using the downloader, for example:
```
./TwitchDownloaderCLI videodownload --id <vod-id-here> -o out.mp4
```
Expand Down Expand Up @@ -169,7 +184,7 @@ dotnet publish TwitchDownloaderWPF -p:PublishProfile=Windows -p:DebugType=None -
```
dotnet publish TwitchDownloaderCLI -p:PublishProfile=<Profile> -p:DebugType=None -p:DebugSymbols=false
```
- Applicable Profiles: `Windows`, `Linux`, `LinuxAlpine`, `LinuxArm`, `LinuxArm64`, `MacOS`
- Applicable Profiles: `Windows`, `Linux`, `LinuxAlpine`, `LinuxArm`, `LinuxArm64`, `MacOS`, `MacOSArm64`
5. a) Navigate to the GUI build folder:
```
cd TwitchDownloaderWPF/bin/Release/net6.0-windows/publish/win-x64
Expand Down
19 changes: 19 additions & 0 deletions TwitchDownloaderCLI/Properties/PublishProfiles/MacOSArm64.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net6.0\publish\MacOSArm64</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifier>osx-arm64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
<PublishTrimmed>True</PublishTrimmed>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
</PropertyGroup>
</Project>

0 comments on commit 1c5a402

Please sign in to comment.