Skip to content

Updated, Lidarr, Prowlarr, Radarr and Readarr #79

Updated, Lidarr, Prowlarr, Radarr and Readarr

Updated, Lidarr, Prowlarr, Radarr and Readarr #79

Workflow file for this run

name: Build
on:
workflow_dispatch:
inputs:
publish:
description: 'Publish to repository'
required: false
default: 'false'
pull_request:
paths:
- 'spk/**'
- 'cross/**'
- 'native/**'
push:
branches:
- master
paths:
- '.github/workflows/*'
- 'spk/**'
- 'cross/**'
- 'native/**'
jobs:
prepare:
name: Prepare for Build
runs-on: ubuntu-latest
# provide results to other jobs
outputs:
arch_packages: ${{ steps.dependencies.outputs.arch_packages }}
noarch_packages: ${{ steps.dependencies.outputs.noarch_packages }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Evaluate dependencies
id: dependencies
run: ./.github/actions/prepare.sh
- name: Cache downloaded files
uses: actions/cache@v3
with:
path: distrib
# use run_id in key to cache within workflow only.
key: distrib-${{ github.run_id }}
- name: Download source files
run: ./.github/actions/download.sh
env:
DOWNLOAD_PACKAGES: ${{ steps.dependencies.outputs.download_packages }}
build:
name: Build
needs: prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# x64=x86_64, evansport=i686, aarch64=armv8, armv7, hi3535=armv7l, 88f6281=armv5, qoriq=ppc
# https://github.com/SynoCommunity/spksrc/wiki/Synology-and-SynoCommunity-Package-Architectures
arch: [x64-6.1, x64-7.0, evansport-6.1, evansport-7.0, aarch64-6.1, aarch64-7.0, armv7-6.1, armv7-7.0, hi3535-6.1, 88f6281-6.1, comcerto2k-7.0]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Cache toolchains
uses: actions/cache@v3
with:
path: toolchain/*/work
key: toolchain-${{ matrix.arch }}-v3-${{ hashFiles('toolchain/*/digests') }}
- name: Use cache of downloaded files
uses: actions/cache@v3
with:
path: distrib
key: distrib-${{ github.run_id }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Build Package (based on changed files)
# We don't want to stop the build on errors.
# Errors are reported in "Build Status"
continue-on-error: true
env:
ARCH_PACKAGES: ${{ needs.prepare.outputs.arch_packages }}
NOARCH_PACKAGES: ${{ needs.prepare.outputs.noarch_packages }}
PUBLISH: ${{ github.event.inputs.publish }}
API_KEY: ${{ secrets.PUBLISH_API_KEY }}
GH_ARCH: ${{ matrix.arch }}
BUILD_ERROR_FILE: /github/workspace/build_errors.txt
BUILD_ERROR_LOGFILE: /github/workspace/build_log_errors.txt
BUILD_UNSUPPORTED_FILE: /github/workspace/build_unsupported.txt
BUILD_SUCCESS_FILE: /github/workspace/build_success.txt
run: |
/usr/bin/docker run --rm --privileged --workdir /github/workspace \
-e ARCH_PACKAGES \
-e NOARCH_PACKAGES \
-e PUBLISH \
-e API_KEY \
-e GH_ARCH \
-e BUILD_ERROR_FILE \
-e BUILD_ERROR_LOGFILE \
-e BUILD_UNSUPPORTED_FILE \
-e BUILD_SUCCESS_FILE \
-e INPUT_ENTRYPOINT -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true --entrypoint "./.github/actions/build.sh" -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/spksrc/spksrc":"/github/workspace" ghcr.io/servarr/spksrc:latest
- name: Build Status
id: build_status
# We need this status since we don't want to stop the build on errors.
# Here we fail on build errors found in the build error file.
uses: docker://ghcr.io/servarr/spksrc:latest
with:
entrypoint: ./.github/actions/build_status.sh
env:
BUILD_ERROR_FILE: /github/workspace/build_errors.txt
BUILD_ERROR_LOGFILE: /github/workspace/build_log_errors.txt
BUILD_UNSUPPORTED_FILE: /github/workspace/build_unsupported.txt
BUILD_SUCCESS_FILE: /github/workspace/build_success.txt
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.arch }}
path: packages/*.spk
if-no-files-found: ignore
publish:
needs: build
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v3
- name: Publish release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create -d -p v$GITHUB_RUN_NUMBER --generate-notes --title "Servarr Synology Packages v$GITHUB_RUN_NUMBER" --target $GITHUB_SHA **/*.spk