Package all the things
This commit is contained in:
parent
e51107f1c9
commit
d640a069cd
|
@ -2,6 +2,12 @@ name: Package
|
||||||
description: Packages binaries for deployment
|
description: Packages binaries for deployment
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
|
platform:
|
||||||
|
description: 'Binary platform'
|
||||||
|
required: true
|
||||||
|
framework:
|
||||||
|
description: '.net framework'
|
||||||
|
required: true
|
||||||
artifact:
|
artifact:
|
||||||
description: 'Binary artifact'
|
description: 'Binary artifact'
|
||||||
required: true
|
required: true
|
||||||
|
@ -18,7 +24,7 @@ inputs:
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
steps:
|
steps:
|
||||||
- name: Download UI Artifact
|
- name: Download Artifact
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.artifact }}
|
name: ${{ inputs.artifact }}
|
||||||
|
@ -27,19 +33,48 @@ runs:
|
||||||
- name: Download UI Artifact
|
- name: Download UI Artifact
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ui
|
name: build_ui
|
||||||
path: _output/UI
|
path: _output/UI
|
||||||
|
|
||||||
|
- name: Configure Environment Variables
|
||||||
|
shell: bash
|
||||||
|
runs: |
|
||||||
|
echo "FRAMEWORK=${{ inputs.framework }}" >> "$GITHUB_ENV"
|
||||||
|
echo "BRANCH=${{ inputs.branch }}" >> "$GITHUB_ENV"
|
||||||
|
echo "SONARR_MAJOR_VERSION=${{ inputs.major_version }}" >> "$GITHUB_ENV"
|
||||||
|
echo "SONARR_VERSION=${{ inputs.version }}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Create Packages
|
- name: Create Packages
|
||||||
shell: bash
|
shell: bash
|
||||||
run: $GITHUB_ACTION_PATH/package.sh
|
run: $GITHUB_ACTION_PATH/package.sh
|
||||||
|
|
||||||
- name: List Artifacts
|
- name: Create Windows Installer (x64)
|
||||||
|
if: ${{ inputs.platform == 'windows' }}
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
SET RUNTIME=win-x64
|
||||||
|
|
||||||
|
cd ./distribution/windows/setup
|
||||||
|
./distribution/windows/setup/build.bat
|
||||||
|
|
||||||
|
- name: Create Windows Installer (x86)
|
||||||
|
if: ${{ inputs.platform == 'windows' }}
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
SET RUNTIME=win-x86
|
||||||
|
|
||||||
|
cd ./distribution/windows/setup
|
||||||
|
./distribution/windows/setup/build.bat
|
||||||
|
|
||||||
|
- name: List Artifacts (Testing)
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ls -l _artifacts
|
run: ls -l _artifacts
|
||||||
|
|
||||||
# - name: Upload Artifact
|
- name: Upload Artifact
|
||||||
# uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
# with:
|
with:
|
||||||
# name: ${{ env.RESULTS_NAME }}
|
name: release_${{ inputs.platform }}
|
||||||
# path: ${{ env.RESULTS_NAME }}
|
path: |
|
||||||
|
_artifacts/*.exe
|
||||||
|
_artifacts/*.tar.gz
|
||||||
|
_artifacts/*.zip
|
||||||
|
|
|
@ -3,20 +3,17 @@
|
||||||
outputFolder=_output
|
outputFolder=_output
|
||||||
artifactsFolder=_artifacts
|
artifactsFolder=_artifacts
|
||||||
uiFolder="$outputFolder/UI"
|
uiFolder="$outputFolder/UI"
|
||||||
|
framework="${FRAMEWORK:=net6.0}"
|
||||||
|
|
||||||
for folder in _artifacts/*
|
for runtime in _artifacts/*
|
||||||
do
|
do
|
||||||
name="${folder##*/}"
|
name="${runtime##*/}"
|
||||||
folderName="$outputFolder/$name"
|
folderName="$runtime/$framework/Sonarr"
|
||||||
sonarrFolder="$folderName/Sonarr"
|
sonarrFolder="$folderName/Sonarr"
|
||||||
|
|
||||||
echo "Creating package for $name"
|
echo "Creating package for $name"
|
||||||
|
|
||||||
rm -rf $folderName
|
echo "Copying UI runtime"
|
||||||
mkdir $folderName
|
|
||||||
cp -r "$folder/net6.0/Sonarr" $sonarrFolder
|
|
||||||
|
|
||||||
echo "Copying UI folder"
|
|
||||||
cp -r $uiFolder $sonarrFolder
|
cp -r $uiFolder $sonarrFolder
|
||||||
|
|
||||||
echo "Setting permissions"
|
echo "Setting permissions"
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
|
|
||||||
|
|
||||||
name: Publish Artifact
|
|
||||||
description: Publishes a build artifact
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
runtime:
|
|
||||||
description: '.net runtime'
|
|
||||||
required: true
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: 'composite'
|
|
||||||
steps:
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ inputs.runtime }}
|
|
||||||
path: _artifacts/${{ inputs.runtime }}/net6.0/**/*
|
|
|
@ -4,6 +4,9 @@ name: Publish Test Artifact
|
||||||
description: Publishes a test artifact
|
description: Publishes a test artifact
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
|
framework:
|
||||||
|
description: '.net framework'
|
||||||
|
required: true
|
||||||
runtime:
|
runtime:
|
||||||
description: '.net runtime'
|
description: '.net runtime'
|
||||||
required: true
|
required: true
|
||||||
|
@ -14,4 +17,4 @@ runs:
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: tests-${{ inputs.runtime }}
|
name: tests-${{ inputs.runtime }}
|
||||||
path: _tests/net6.0/${{ inputs.runtime }}/publish/**/*
|
path: _tests/${{ inputs.framework }}/${{ inputs.runtime }}/publish/**/*
|
||||||
|
|
|
@ -14,6 +14,7 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
FRAMEWORK: net6.0
|
||||||
BRANCH: ${{ github.head_ref || github.ref_name }}
|
BRANCH: ${{ github.head_ref || github.ref_name }}
|
||||||
SONARR_MAJOR_VERSION: 4
|
SONARR_MAJOR_VERSION: 4
|
||||||
VERSION: 4.0.0
|
VERSION: 4.0.0
|
||||||
|
@ -22,6 +23,7 @@ jobs:
|
||||||
backend:
|
backend:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
outputs:
|
outputs:
|
||||||
|
framework: ${{ steps.variables.outputs.framework }}
|
||||||
major_version: ${{ steps.variables.outputs.major_version }}
|
major_version: ${{ steps.variables.outputs.major_version }}
|
||||||
version: ${{ steps.variables.outputs.version }}
|
version: ${{ steps.variables.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
|
@ -38,6 +40,7 @@ jobs:
|
||||||
DOTNET_VERSION=$(jq -r '.sdk.version' global.json)
|
DOTNET_VERSION=$(jq -r '.sdk.version' global.json)
|
||||||
echo "SDK_PATH=${{ env.DOTNET_ROOT }}/sdk/${DOTNET_VERSION}" >> "$GITHUB_ENV"
|
echo "SDK_PATH=${{ env.DOTNET_ROOT }}/sdk/${DOTNET_VERSION}" >> "$GITHUB_ENV"
|
||||||
echo "SONARR_VERSION=${{ env.VERSION }}.${{ github.run_number }}" >> "$GITHUB_ENV"
|
echo "SONARR_VERSION=${{ env.VERSION }}.${{ github.run_number }}" >> "$GITHUB_ENV"
|
||||||
|
echo "framework=${{ env.FRAMEWORK }}" >> "$GITHUB_OUTPUT"
|
||||||
echo "major_version=${{ env.SONARR_MAJOR_VERSION }}" >> "$GITHUB_OUTPUT"
|
echo "major_version=${{ env.SONARR_MAJOR_VERSION }}" >> "$GITHUB_OUTPUT"
|
||||||
echo "version=${{ env.VERSION }}.${{ github.run_number }}" >> "$GITHUB_OUTPUT"
|
echo "version=${{ env.VERSION }}.${{ github.run_number }}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
@ -54,16 +57,19 @@ jobs:
|
||||||
- name: Publish win-x64 Test Artifact
|
- name: Publish win-x64 Test Artifact
|
||||||
uses: ./.github/actions/publish-test-artifact
|
uses: ./.github/actions/publish-test-artifact
|
||||||
with:
|
with:
|
||||||
|
framework: ${{ env.FRAMEWORK }}
|
||||||
runtime: win-x64
|
runtime: win-x64
|
||||||
|
|
||||||
- name: Publish linux-x64 Test Artifact
|
- name: Publish linux-x64 Test Artifact
|
||||||
uses: ./.github/actions/publish-test-artifact
|
uses: ./.github/actions/publish-test-artifact
|
||||||
with:
|
with:
|
||||||
|
framework: ${{ env.FRAMEWORK }}
|
||||||
runtime: linux-x64
|
runtime: linux-x64
|
||||||
|
|
||||||
- name: Publish osx-x64 Test Artifact
|
- name: Publish osx-x64 Test Artifact
|
||||||
uses: ./.github/actions/publish-test-artifact
|
uses: ./.github/actions/publish-test-artifact
|
||||||
with:
|
with:
|
||||||
|
framework: ${{ env.FRAMEWORK }}
|
||||||
runtime: osx-x64
|
runtime: osx-x64
|
||||||
|
|
||||||
# Build Artifacts (grouped by OS)
|
# Build Artifacts (grouped by OS)
|
||||||
|
@ -113,7 +119,7 @@ jobs:
|
||||||
- name: Publish UI Artifact
|
- name: Publish UI Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ui
|
name: build_ui
|
||||||
path: _output/UI/**/*
|
path: _output/UI/**/*
|
||||||
|
|
||||||
unit_test:
|
unit_test:
|
||||||
|
@ -170,17 +176,17 @@ jobs:
|
||||||
artifact: tests-linux-x64
|
artifact: tests-linux-x64
|
||||||
filter: TestCategory!=ManualTest&TestCategory!=WINDOWS&TestCategory=IntegrationTest
|
filter: TestCategory!=ManualTest&TestCategory!=WINDOWS&TestCategory=IntegrationTest
|
||||||
binary_artifact: build_linux
|
binary_artifact: build_linux
|
||||||
binary_path: linux-x64/net6.0/Sonarr
|
binary_path: linux-x64/${{ needs.backend.outputs.framework }}/Sonarr
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
artifact: tests-osx-x64
|
artifact: tests-osx-x64
|
||||||
filter: TestCategory!=ManualTest&TestCategory!=WINDOWS&TestCategory=IntegrationTest
|
filter: TestCategory!=ManualTest&TestCategory!=WINDOWS&TestCategory=IntegrationTest
|
||||||
binary_artifact: build_macos
|
binary_artifact: build_macos
|
||||||
binary_path: osx-x64/net6.0/Sonarr
|
binary_path: osx-x64/${{ needs.backend.outputs.framework }}/Sonarr
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
artifact: tests-win-x64
|
artifact: tests-win-x64
|
||||||
filter: TestCategory!=ManualTest&TestCategory=WINDOWS&TestCategory=IntegrationTest
|
filter: TestCategory!=ManualTest&TestCategory=WINDOWS&TestCategory=IntegrationTest
|
||||||
binary_artifact: build_windows
|
binary_artifact: build_windows
|
||||||
binary_path: win-x64/net6.0/Sonarr
|
binary_path: win-x64/${{ needs.backend.outputs.framework }}/Sonarr
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out
|
- name: Check out
|
||||||
|
@ -203,6 +209,7 @@ jobs:
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
uses: ./.github/workflows/deploy.yml
|
uses: ./.github/workflows/deploy.yml
|
||||||
with:
|
with:
|
||||||
|
framework: ${{ needs.backend.outputs.framework }}
|
||||||
branch: ${{ github.ref_name }}
|
branch: ${{ github.ref_name }}
|
||||||
major_version: ${{ needs.backend.outputs.major_version }}
|
major_version: ${{ needs.backend.outputs.major_version }}
|
||||||
version: ${{ needs.backend.outputs.version }}
|
version: ${{ needs.backend.outputs.version }}
|
||||||
|
|
|
@ -3,19 +3,39 @@ name: Deploy
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
|
framework:
|
||||||
|
description: '.net framework'
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
branch:
|
branch:
|
||||||
required: true
|
description: 'Git branch used for this build'
|
||||||
type: string
|
type: string
|
||||||
|
required: true
|
||||||
major_version:
|
major_version:
|
||||||
required: true
|
description: 'Sonarr major version'
|
||||||
type: string
|
type: string
|
||||||
|
required: true
|
||||||
version:
|
version:
|
||||||
required: true
|
description: 'Sonarr version'
|
||||||
type: string
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
package_windows:
|
package:
|
||||||
runs-on: windows-latest
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest]
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
platform: freebsd
|
||||||
|
- os: ubuntu-latest
|
||||||
|
platform: linux
|
||||||
|
- os: ubuntu-latest
|
||||||
|
platform: macos
|
||||||
|
- os: windows-latest
|
||||||
|
platform: windows
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out
|
- name: Check out
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
@ -23,19 +43,9 @@ jobs:
|
||||||
- name: Package
|
- name: Package
|
||||||
uses: ./.github/actions/package
|
uses: ./.github/actions/package
|
||||||
with:
|
with:
|
||||||
artifact: build_windows
|
framework: ${{ inputs.framework }}
|
||||||
|
platform: ${{ matrix.platform }}
|
||||||
|
artifact: build_${{ matrix.platform }}
|
||||||
branch: ${{ inputs.branch }}
|
branch: ${{ inputs.branch }}
|
||||||
|
major_version: ${{ inputs.major_version }}
|
||||||
version: ${{ inputs.version }}
|
version: ${{ inputs.version }}
|
||||||
|
|
||||||
|
|
||||||
# package_linux:
|
|
||||||
# runs-on: ubuntu-latest
|
|
||||||
# steps:
|
|
||||||
# - name: Check out
|
|
||||||
# uses: actions/checkout@v3
|
|
||||||
|
|
||||||
# - name: Download Artifact
|
|
||||||
# uses: actions/download-artifact@v4
|
|
||||||
# with:
|
|
||||||
# name: build_linux
|
|
||||||
# path: _artifacts
|
|
||||||
|
|
41
build.sh
41
build.sh
|
@ -4,6 +4,7 @@ set -e
|
||||||
outputFolder='_output'
|
outputFolder='_output'
|
||||||
testPackageFolder='_tests'
|
testPackageFolder='_tests'
|
||||||
artifactsFolder="_artifacts";
|
artifactsFolder="_artifacts";
|
||||||
|
framework="${FRAMEWORK:=net6.0}"
|
||||||
|
|
||||||
ProgressStart()
|
ProgressStart()
|
||||||
{
|
{
|
||||||
|
@ -138,7 +139,7 @@ PackageLinux()
|
||||||
|
|
||||||
echo "Adding Sonarr.Mono to UpdatePackage"
|
echo "Adding Sonarr.Mono to UpdatePackage"
|
||||||
cp $folder/Sonarr.Mono.* $folder/Sonarr.Update
|
cp $folder/Sonarr.Mono.* $folder/Sonarr.Update
|
||||||
if [ "$framework" = "net6.0" ]; then
|
if [ "$framework" = "$framework" ]; then
|
||||||
cp $folder/Mono.Posix.NETStandard.* $folder/Sonarr.Update
|
cp $folder/Mono.Posix.NETStandard.* $folder/Sonarr.Update
|
||||||
cp $folder/libMonoPosixHelper.* $folder/Sonarr.Update
|
cp $folder/libMonoPosixHelper.* $folder/Sonarr.Update
|
||||||
fi
|
fi
|
||||||
|
@ -166,7 +167,7 @@ PackageMacOS()
|
||||||
|
|
||||||
echo "Adding Sonarr.Mono to UpdatePackage"
|
echo "Adding Sonarr.Mono to UpdatePackage"
|
||||||
cp $folder/Sonarr.Mono.* $folder/Sonarr.Update
|
cp $folder/Sonarr.Mono.* $folder/Sonarr.Update
|
||||||
if [ "$framework" = "net6.0" ]; then
|
if [ "$framework" = "$framework" ]; then
|
||||||
cp $folder/Mono.Posix.NETStandard.* $folder/Sonarr.Update
|
cp $folder/Mono.Posix.NETStandard.* $folder/Sonarr.Update
|
||||||
cp $folder/libMonoPosixHelper.* $folder/Sonarr.Update
|
cp $folder/libMonoPosixHelper.* $folder/Sonarr.Update
|
||||||
fi
|
fi
|
||||||
|
@ -398,20 +399,20 @@ then
|
||||||
|
|
||||||
if [[ -z "$RID" || -z "$FRAMEWORK" ]];
|
if [[ -z "$RID" || -z "$FRAMEWORK" ]];
|
||||||
then
|
then
|
||||||
PackageTests "net6.0" "win-x64"
|
PackageTests "$framework" "win-x64"
|
||||||
PackageTests "net6.0" "win-x86"
|
PackageTests "$framework" "win-x86"
|
||||||
PackageTests "net6.0" "linux-x64"
|
PackageTests "$framework" "linux-x64"
|
||||||
PackageTests "net6.0" "linux-musl-x64"
|
PackageTests "$framework" "linux-musl-x64"
|
||||||
PackageTests "net6.0" "osx-x64"
|
PackageTests "$framework" "osx-x64"
|
||||||
if [ "$ENABLE_EXTRA_PLATFORMS" = "YES" ];
|
if [ "$ENABLE_EXTRA_PLATFORMS" = "YES" ];
|
||||||
then
|
then
|
||||||
PackageTests "net6.0" "freebsd-x64"
|
PackageTests "$framework" "freebsd-x64"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
PackageTests "$FRAMEWORK" "$RID"
|
PackageTests "$FRAMEWORK" "$RID"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
UploadTestArtifacts "net6.0"
|
UploadTestArtifacts "$framework"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$FRONTEND" = "YES" ];
|
if [ "$FRONTEND" = "YES" ];
|
||||||
|
@ -433,22 +434,22 @@ then
|
||||||
|
|
||||||
if [[ -z "$RID" || -z "$FRAMEWORK" ]];
|
if [[ -z "$RID" || -z "$FRAMEWORK" ]];
|
||||||
then
|
then
|
||||||
Package "net6.0" "win-x64"
|
Package "$framework" "win-x64"
|
||||||
Package "net6.0" "win-x86"
|
Package "$framework" "win-x86"
|
||||||
Package "net6.0" "linux-x64"
|
Package "$framework" "linux-x64"
|
||||||
Package "net6.0" "linux-musl-x64"
|
Package "$framework" "linux-musl-x64"
|
||||||
Package "net6.0" "linux-arm64"
|
Package "$framework" "linux-arm64"
|
||||||
Package "net6.0" "linux-musl-arm64"
|
Package "$framework" "linux-musl-arm64"
|
||||||
Package "net6.0" "linux-arm"
|
Package "$framework" "linux-arm"
|
||||||
Package "net6.0" "osx-x64"
|
Package "$framework" "osx-x64"
|
||||||
Package "net6.0" "osx-arm64"
|
Package "$framework" "osx-arm64"
|
||||||
if [ "$ENABLE_EXTRA_PLATFORMS" = "YES" ];
|
if [ "$ENABLE_EXTRA_PLATFORMS" = "YES" ];
|
||||||
then
|
then
|
||||||
Package "net6.0" "freebsd-x64"
|
Package "$framework" "freebsd-x64"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
Package "$FRAMEWORK" "$RID"
|
Package "$FRAMEWORK" "$RID"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
UploadArtifacts "net6.0"
|
UploadArtifacts "$framework"
|
||||||
fi
|
fi
|
||||||
|
|
3
docs.sh
3
docs.sh
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
FRAMEWORK="net6.0"
|
||||||
PLATFORM=$1
|
PLATFORM=$1
|
||||||
|
|
||||||
if [ "$PLATFORM" = "Windows" ]; then
|
if [ "$PLATFORM" = "Windows" ]; then
|
||||||
|
@ -32,7 +33,7 @@ dotnet msbuild -restore $slnFile -p:Configuration=Debug -p:Platform=$platform -p
|
||||||
dotnet new tool-manifest
|
dotnet new tool-manifest
|
||||||
dotnet tool install --version 6.5.0 Swashbuckle.AspNetCore.Cli
|
dotnet tool install --version 6.5.0 Swashbuckle.AspNetCore.Cli
|
||||||
|
|
||||||
dotnet tool run swagger tofile --output ./src/Sonarr.Api.V3/openapi.json "$outputFolder/net6.0/$RUNTIME/Sonarr.dll" v3 &
|
dotnet tool run swagger tofile --output ./src/Sonarr.Api.V3/openapi.json "$outputFolder/$FRAMEWORK/$RUNTIME/Sonarr.dll" v3 &
|
||||||
|
|
||||||
sleep 30
|
sleep 30
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue