feat: Support ARM and ARM64 builds of all platforms

pull/47/head
Robert Dailey 2 years ago
parent 279804004e
commit f0ba34c90e

@ -20,16 +20,10 @@ jobs:
strategy: strategy:
fail-fast: true fail-fast: true
matrix: matrix:
include: runtime: [win-x64, win-arm64, linux-x64, linux-arm, linux-arm64, osx-x64, osx-arm64]
- runtime: win-x64
image: windows-latest
- runtime: linux-x64
image: ubuntu-latest
- runtime: osx-x64
image: macos-latest
# Must run on Windows so that version info gets properly set in host EXE. See: # Must run on Windows so that version info gets properly set in host EXE. See:
# https://github.com/dotnet/runtime/issues/3828 # https://github.com/dotnet/runtime/issues/3828
runs-on: ${{ matrix.image }} runs-on: windows-latest
steps: steps:
- name: Checkout Source Code - name: Checkout Source Code
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -44,15 +38,65 @@ jobs:
- name: Test - name: Test
run: dotnet test src --configuration Release --logger GitHubActions run: dotnet test src --configuration Release --logger GitHubActions
- name: Publish & Zip - name: Publish
shell: pwsh shell: pwsh
run: ci/PublishAndZip.ps1 ${{ matrix.runtime }} run: ci/Publish.ps1 ${{ matrix.runtime }}
- name: Smoke Test
shell: pwsh
run: ci/SmokeTest.ps1 ${{ matrix.runtime }}
if: ${{ endsWith(matrix.runtime, 'linux-x64') }}
- name: Upload Artifacts - name: Upload Artifacts
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: trash name: trash-${{ matrix.runtime }}
path: publish/zip/trash-*.zip path: publish/${{ matrix.runtime }}/*
release:
name: Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # avoid shallow clone for GitVersion
# token: ${{ secrets.GITHUB_TOKEN }} # Allows git push
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: 5.x
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0.9.7
id: gitversion
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
path: publish
- name: Create Zip Files
shell: pwsh
run: ci/CreateZip.ps1 publish
- name: Extract Changelog
id: changelog
uses: ffurrer2/extract-release-notes@v1
- name: Create Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
files: publish-zip/trash-*.zip
body: ${{ steps.changelog.outputs.release_notes }}
tag_name: ${{ github.event.create.ref }}
draft: false
prerelease: ${{ steps.gitversion.outputs.preReleaseTag != '' }}
sonarcloud: sonarcloud:
name: SonarCloud name: SonarCloud
@ -109,44 +153,3 @@ jobs:
run: > run: >
dotnet sonarscanner end dotnet sonarscanner end
-d:sonar.login="${{ secrets.SONAR_TOKEN }}" -d:sonar.login="${{ secrets.SONAR_TOKEN }}"
release:
name: Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # avoid shallow clone for GitVersion
# token: ${{ secrets.GITHUB_TOKEN }} # Allows git push
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: 5.x
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0.9.7
id: gitversion
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: trash
- name: Extract Changelog
id: changelog
uses: ffurrer2/extract-release-notes@v1
- name: Create Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
files: trash-*.zip
body: ${{ steps.changelog.outputs.release_notes }}
tag_name: ${{ github.event.create.ref }}
draft: false
prerelease: ${{ steps.gitversion.outputs.preReleaseTag != '' }}

@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Added
- 64-bit ARM builds for Windows, Linux, and Mac OS.
## [1.7.0] - 2022-02-06 ## [1.7.0] - 2022-02-06
### Added ### Added

@ -44,11 +44,23 @@ Automatically mirror TRaSH guides to your Sonarr/Radarr instance.
## Installation ## Installation
Simply download the latest release for your platform: Simply download the latest release for your platform using the table below. The download itself is
just a ZIP file with a single executable in it. You can put this executable anywhere you want and
- [Windows (64-bit)](https://github.com/rcdailey/trash-updater/releases/latest/download/trash-win-x64.zip) run it.
- [Linux (64-bit)](https://github.com/rcdailey/trash-updater/releases/latest/download/trash-linux-x64.zip)
- [macOS (64-bit)](https://github.com/rcdailey/trash-updater/releases/latest/download/trash-osx-x64.zip) | Platform | 32-bit | 64-bit |
| -------- | ---------------- | -------------------------------------- |
| Windows | --- | [x64][win-x64], [arm64][win-arm64] |
| Linux | [arm][linux-arm] | [x64][linux-x64], [arm64][linux-arm64] |
| Mac OS | --- | [x64][osx-x64], [arm64][osx-arm64] |
[win-x64]: https://github.com/rcdailey/trash-updater/releases/latest/download/trash-win-x64.zip
[win-arm64]: https://github.com/rcdailey/trash-updater/releases/latest/download/trash-win-arm64.zip
[linux-x64]: https://github.com/rcdailey/trash-updater/releases/latest/download/trash-linux-x64.zip
[linux-arm64]: https://github.com/rcdailey/trash-updater/releases/latest/download/trash-linux-arm64.zip
[linux-arm]: https://github.com/rcdailey/trash-updater/releases/latest/download/trash-linux-arm.zip
[osx-x64]: https://github.com/rcdailey/trash-updater/releases/latest/download/trash-osx-x64.zip
[osx-arm64]: https://github.com/rcdailey/trash-updater/releases/latest/download/trash-osx-arm64.zip
The above links are from the latest release on the [releases page][rp]. Feel free to visit there for The above links are from the latest release on the [releases page][rp]. Feel free to visit there for
release notes and older releases. release notes and older releases.
@ -64,16 +76,18 @@ release notes and older releases.
### Special Note about Linux ### Special Note about Linux
When you extract the ZIP archive on Linux, it will *not* have the executable permission set. Here is When you extract the ZIP archive on Linux, it will *not* have the executable permission set. After
a quick one-liner you can use in a terminal to download the latest release, extract it, and set it you've downloaded and extracted the executable, you can use the command below to make it executable.
as executable. It will also replace any existing `trash` executable, so this is useful for upgrades,
too. Run this from the directory where you want `trash` to be installed.
```bash ```bash
wget -O trash.zip https://github.com/rcdailey/trash-updater/releases/latest/download/trash-linux-x64.zip \ chmod u+rx trash
&& unzip -o trash.zip && rm trash.zip && chmod u+rx trash
``` ```
*Note: There used to be a convenient one-liner available here, but that was removed with the
introduction of multiple architecture support. That one liner was no longer sufficient and a more
complex solution was needed to determine which architecture to download for. But if you're using
linux, I think you can handle what needs to be done :-)*
## Getting Started ## Getting Started
Trash Updater requires a YAML configuration file in order to work. Run the steps below if you want Trash Updater requires a YAML configuration file in order to work. Run the steps below if you want

@ -0,0 +1,16 @@
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string] $RootPath
)
$ErrorActionPreference = "Stop"
$ZipPath = "$RootPath-zip"
"Zip the published files to: $ZipPath"
New-Item -ItemType Directory -Force -Path $ZipPath
$dirs = Get-ChildItem -Path $RootPath -Directory -Name
foreach ($dir in $dirs) {
"> Zipping: $RootPath\$dir"
Compress-Archive $RootPath\$dir\* $ZipPath\$dir.zip -Force
}

@ -6,8 +6,6 @@ param (
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
& "$PSScriptRoot\Publish.ps1" $runtime
if (Get-Command chmod -errorAction SilentlyContinue) { if (Get-Command chmod -errorAction SilentlyContinue) {
"The chmod command was found. Setting read + execute permission." "The chmod command was found. Setting read + execute permission."
& chmod +rx ./publish/$runtime/trash & chmod +rx ./publish/$runtime/trash
@ -19,7 +17,3 @@ if ($LASTEXITCODE -ne 0) {
"Trash executable failed to run with exit code: $LASTEXITCODE" "Trash executable failed to run with exit code: $LASTEXITCODE"
exit -1 exit -1
} }
"Zip the published files"
New-Item -ItemType Directory -Force -Path publish\zip
Compress-Archive publish\$runtime\* publish\zip\trash-$runtime.zip -Force
Loading…
Cancel
Save