diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f59cd62..b9995f6d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,16 +20,10 @@ jobs: strategy: fail-fast: true matrix: - include: - - runtime: win-x64 - image: windows-latest - - runtime: linux-x64 - image: ubuntu-latest - - runtime: osx-x64 - image: macos-latest + runtime: [win-x64, win-arm64, linux-x64, linux-arm, linux-arm64, osx-x64, osx-arm64] # Must run on Windows so that version info gets properly set in host EXE. See: # https://github.com/dotnet/runtime/issues/3828 - runs-on: ${{ matrix.image }} + runs-on: windows-latest steps: - name: Checkout Source Code uses: actions/checkout@v2 @@ -44,15 +38,65 @@ jobs: - name: Test run: dotnet test src --configuration Release --logger GitHubActions - - name: Publish & Zip + - name: Publish 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 uses: actions/upload-artifact@v2 with: - name: trash - path: publish/zip/trash-*.zip + name: trash-${{ matrix.runtime }} + 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: name: SonarCloud @@ -109,44 +153,3 @@ jobs: run: > dotnet sonarscanner end -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 != '' }} diff --git a/CHANGELOG.md b/CHANGELOG.md index d255c645..698b01b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- 64-bit ARM builds for Windows, Linux, and Mac OS. + ## [1.7.0] - 2022-02-06 ### Added diff --git a/README.md b/README.md index e807f81c..5a18d6e0 100644 --- a/README.md +++ b/README.md @@ -44,11 +44,23 @@ Automatically mirror TRaSH guides to your Sonarr/Radarr instance. ## Installation -Simply download the latest release for your platform: - -- [Windows (64-bit)](https://github.com/rcdailey/trash-updater/releases/latest/download/trash-win-x64.zip) -- [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) +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 +run it. + +| 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 release notes and older releases. @@ -64,16 +76,18 @@ release notes and older releases. ### Special Note about Linux -When you extract the ZIP archive on Linux, it will *not* have the executable permission set. Here is -a quick one-liner you can use in a terminal to download the latest release, extract it, and set it -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. +When you extract the ZIP archive on Linux, it will *not* have the executable permission set. After +you've downloaded and extracted the executable, you can use the command below to make it executable. ```bash - wget -O trash.zip https://github.com/rcdailey/trash-updater/releases/latest/download/trash-linux-x64.zip \ - && unzip -o trash.zip && rm trash.zip && chmod u+rx trash +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 Trash Updater requires a YAML configuration file in order to work. Run the steps below if you want diff --git a/ci/CreateZip.ps1 b/ci/CreateZip.ps1 new file mode 100644 index 00000000..f8ac14be --- /dev/null +++ b/ci/CreateZip.ps1 @@ -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 +} diff --git a/ci/PublishAndZip.ps1 b/ci/SmokeTest.ps1 similarity index 71% rename from ci/PublishAndZip.ps1 rename to ci/SmokeTest.ps1 index bb6ecb5e..d5610d3a 100644 --- a/ci/PublishAndZip.ps1 +++ b/ci/SmokeTest.ps1 @@ -6,8 +6,6 @@ param ( $ErrorActionPreference = "Stop" -& "$PSScriptRoot\Publish.ps1" $runtime - if (Get-Command chmod -errorAction SilentlyContinue) { "The chmod command was found. Setting read + execute permission." & chmod +rx ./publish/$runtime/trash @@ -19,7 +17,3 @@ if ($LASTEXITCODE -ne 0) { "Trash executable failed to run with exit code: $LASTEXITCODE" exit -1 } - -"Zip the published files" -New-Item -ItemType Directory -Force -Path publish\zip -Compress-Archive publish\$runtime\* publish\zip\trash-$runtime.zip -Force