diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml deleted file mode 100644 index d701774e..00000000 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ /dev/null @@ -1,180 +0,0 @@ ---- -name: Bug Report -description: Create a bug report to help us improve. -body: - - type: markdown - attributes: - value: > - **THIS IS NOT THE PLACE TO ASK FOR SUPPORT!** - Please use our [Support Center](https://app.lizardbyte.dev/support) for support issues. - Non actionable bug reports will be locked and closed! - - type: checkboxes - attributes: - label: Is there an existing issue for this? - description: Please search to see if an issue already exists for the bug you encountered. - options: - - label: I have searched the existing issues - required: true - - type: checkboxes - attributes: - label: Is your issue described in the documentation? - description: Please read our [documentation](https://docs.lizardbyte.dev/projects/sunshine) - options: - - label: I have read the documentation - required: true - - type: checkboxes - attributes: - label: Is your issue present in the nightly release? - description: Please test the [nightly](https://github.com/LizardByte/Sunshine/releases/tag/nightly-dev) release - options: - - label: This issue is present in the nightly release - required: true - - type: textarea - id: description - attributes: - label: Describe the Bug - description: A clear and concise description of the bug. - validations: - required: true - - type: textarea - id: expected - attributes: - label: Expected Behavior - description: A clear and concise description of what you expected to happen. - - type: textarea - id: additional - attributes: - label: Additional Context - description: Add any other context about the bug here. - - type: dropdown - id: os - attributes: - label: Host Operating System - description: What version operating system are you running the software on? - options: - - Docker - - Linux - - macOS - - Windows - - other, n/a - validations: - required: true - - type: input - id: os-version - attributes: - label: Operating System Version - description: Provide the version of the operating system. Additionally a build number would be helpful. - validations: - required: true - - type: dropdown - id: os-architecture - attributes: - label: Architecture - options: - - 32 bit - - 64 bit - - arm - - other, n/a - validations: - required: true - - type: input - id: version - attributes: - label: Sunshine commit or version - placeholder: eg. 0.18.0 - validations: - required: true - - type: dropdown - id: package_type - attributes: - label: Package - description: The package you installed - options: - - Linux - AppImage - - Linux - AUR (Third Party) - - Linux - deb - - Linux - Docker - - Linux - flatpak - - Linux - nixpkgs (Third Party) - - Linux - PKGBUILD - - Linux - pkg.tar.zst - - Linux - rpm - - Linux - solus (Third Party) - - macOS - dmg - - macOS - Portfile - - Windows - Chocolatey (Third Party) - - Windows - installer - - Windows - portable - - Windows - Scoop (Third Party) - - Windows - Winget (Third Party) - - other (not listed) - - other (self built) - - other (fork of this repo) - - n/a - validations: - required: true - - type: dropdown - id: graphics_type - attributes: - label: GPU Type - description: The type of the installed graphics card. - options: - - AMD - - Intel - - Nvidia - - none (software encoding) - - n/a - validations: - required: true - - type: input - id: graphics_model - attributes: - label: GPU Model - description: The model of the installed graphics card. - placeholder: e.g. GeForce RTX 2080 SUPER - validations: - required: true - - type: input - id: graphics_driver - attributes: - label: GPU Driver/Mesa Version - description: The driver/mesa version of the installed graphics card. - placeholder: e.g. 497.29 - validations: - required: true - - type: input - id: capture_method - attributes: - label: Capture Method (Linux Only) - description: If on Linux, the capture method being used. - placeholder: e.g. PipeWire/KVM/X11/KMS - validations: - required: false - - type: textarea - id: config - attributes: - label: Config - description: | - Please copy and paste your config (`sunshine.conf`) file. - render: Shell - validations: - required: true - - type: textarea - id: apps - attributes: - label: Apps - description: | - If this is an issue with launching a game or app, please copy and paste your `apps.json` file. - render: json - validations: - required: false - - type: textarea - id: logs - attributes: - label: Relevant log output - description: | - Please copy and paste any relevant log output. This will be automatically formatted into code, - so no need for backticks. - render: shell - validations: - required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 296a44db..00000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -blank_issues_enabled: false -contact_links: - - name: Support Center - url: https://app.lizardbyte.dev/support - about: Official LizardByte support - - name: Feature request - url: https://ideas.moonlight-stream.org - about: Share your suggestions or ideas to help Moonlight and Sunshine improve diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 6eb0cda2..00000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -version: 2 -updates: - - package-ecosystem: "docker" - directory: "/" - schedule: - interval: "daily" - time: "08:00" - open-pull-requests-limit: 10 - - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - time: "08:30" - open-pull-requests-limit: 10 - - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "daily" - time: "09:00" - open-pull-requests-limit: 10 - - - package-ecosystem: "nuget" - directory: "/" - schedule: - interval: "daily" - time: "09:30" - open-pull-requests-limit: 10 - - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "daily" - time: "10:00" - open-pull-requests-limit: 10 - - - package-ecosystem: "gitsubmodule" - directory: "/" - schedule: - interval: "daily" - time: "10:30" - open-pull-requests-limit: 10 diff --git a/.github/label-actions.yml b/.github/label-actions.yml deleted file mode 100644 index 29496018..00000000 --- a/.github/label-actions.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# Configuration for Label Actions - https://github.com/dessant/label-actions - -added: - comment: > - This feature has been added and will be available in the next release. -fixed: - comment: > - This issue has been fixed and will be available in the next release. -invalid:duplicate: - comment: > - :wave: @{issue-author}, this appears to be a duplicate of a pre-existing issue. - close: true - lock: true - unlabel: 'status:awaiting-triage' - --invalid:duplicate: - reopen: true - unlock: true - -invalid:support: - comment: > - :wave: @{issue-author}, we use the issue tracker exclusively for bug reports. - However, this issue appears to be a support request. Please use our - [Support Center](https://app.lizardbyte.dev/support) for support issues. Thanks. - close: true - lock: true - lock-reason: 'off-topic' - unlabel: 'status:awaiting-triage' - --invalid:support: - reopen: true - unlock: true - -invalid:template-incomplete: - issues: - comment: > - :wave: @{issue-author}, please edit your issue to complete the template with - all the required info. Your issue will be automatically closed in 5 days if - the template is not completed. Thanks. - prs: - comment: > - :wave: @{issue-author}, please edit your PR to complete the template with - all the required info. Your PR will be automatically closed in 5 days if - the template is not completed. Thanks. diff --git a/.github/pr_release_template.md b/.github/pr_release_template.md deleted file mode 100644 index b6f6acf5..00000000 --- a/.github/pr_release_template.md +++ /dev/null @@ -1,28 +0,0 @@ -## Description - -This PR was created automatically. - - -### Screenshot - - - -### Issues Fixed or Closed - - - - - -## Type of Change -- [ ] Bug fix (non-breaking change which fixes an issue) -- [ ] New feature (non-breaking change which adds functionality) -- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) -- [ ] Dependency update (updates to dependencies) -- [ ] Documentation update (changes to documentation) -- [ ] Repository update (changes to repository files, e.g. `.github/...`) - -## Branch Updates -- [x] I want maintainers to keep my branch updated - -## Changelog Summary - diff --git a/.github/workflows/auto-create-pr.yml b/.github/workflows/auto-create-pr.yml deleted file mode 100644 index 13705dd5..00000000 --- a/.github/workflows/auto-create-pr.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# This workflow creates a PR automatically when anything is merged/pushed into the `nightly` branch. The PR is created -# against the `master` (default) branch. - -name: Auto create PR - -on: - push: - branches: - - 'nightly' - -jobs: - create_pr: - if: startsWith(github.repository, 'LizardByte/') - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Create Pull Request - uses: repo-sync/pull-request@v2 - with: - source_branch: "" # should be "nightly" as it's the triggering branch - destination_branch: "master" - pr_title: "Pulling ${{ github.ref_name }} into master" - pr_template: ".github/pr_release_template.md" - pr_assignee: "${{ secrets.GH_BOT_NAME }}" - pr_draft: true - pr_allow_empty: false - github_token: ${{ secrets.GH_BOT_TOKEN }} diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml deleted file mode 100644 index 49ddebf4..00000000 --- a/.github/workflows/automerge.yml +++ /dev/null @@ -1,64 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# This workflow will, first, automatically approve PRs created by @LizardByte-bot. Then it will automerge relevant PRs. - -name: Automerge PR - -on: - pull_request: - types: - - opened - - synchronize - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - autoapprove: - if: >- - contains(fromJson('["LizardByte-bot"]'), github.event.pull_request.user.login) && - contains(fromJson('["LizardByte-bot"]'), github.actor) && - startsWith(github.repository, 'LizardByte/') - runs-on: ubuntu-latest - steps: - - name: Autoapproving - uses: hmarr/auto-approve-action@v3 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - name: Label autoapproved - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.GH_BOT_TOKEN }} - script: | - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['autoapproved', 'autoupdate'] - }) - - automerge: - if: startsWith(github.repository, 'LizardByte/') - needs: [autoapprove] - runs-on: ubuntu-latest - - steps: - - name: Automerging - uses: pascalgn/automerge-action@v0.15.6 - env: - BASE_BRANCHES: nightly - GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }} - GITHUB_LOGIN: ${{ secrets.GH_BOT_NAME }} - MERGE_LABELS: "!dependencies" - MERGE_METHOD: "squash" - MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})" - MERGE_DELETE_BRANCH: true - MERGE_ERROR_FAIL: true - MERGE_FILTER_AUTHOR: ${{ secrets.GH_BOT_NAME }} - MERGE_RETRIES: "240" # 1 hour - MERGE_RETRY_SLEEP: "15000" # 15 seconds diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml deleted file mode 100644 index edeeb2bd..00000000 --- a/.github/workflows/ci-docker.yml +++ /dev/null @@ -1,425 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# This workflow is intended to work with all our organization Docker projects. A readme named `DOCKER_README.md` -# will be used to update the description on Docker hub. - -# custom comments in dockerfiles: - -# `# platforms: ` -# Comma separated list of platforms, i.e. `# platforms: linux/386,linux/amd64`. Docker platforms can alternatively -# be listed in a file named `.docker_platforms`. -# `# platforms_pr: ` -# Comma separated list of platforms to run for PR events, i.e. `# platforms_pr: linux/amd64`. This will take -# precedence over the `# platforms: ` directive. -# `# artifacts: ` -# `true` to build in two steps, stopping at `artifacts` build stage and extracting the image from there to the -# GitHub runner. - -name: CI Docker - -on: - pull_request: - branches: [master, nightly] - types: [opened, synchronize, reopened] - push: - branches: [master, nightly] - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - check_dockerfiles: - name: Check Dockerfiles - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Find dockerfiles - id: find - run: | - dockerfiles=$(find . -type f -iname "Dockerfile" -o -iname "*.dockerfile") - - echo "found dockerfiles: ${dockerfiles}" - - # do not quote to keep this as a single line - echo dockerfiles=${dockerfiles} >> $GITHUB_OUTPUT - - MATRIX_COMBINATIONS="" - for FILE in ${dockerfiles}; do - # extract tag from file name - tag=$(echo $FILE | sed -r -z -e 's/(\.\/)*.*\/(Dockerfile)/None/gm') - if [[ $tag == "None" ]]; then - MATRIX_COMBINATIONS="$MATRIX_COMBINATIONS {\"dockerfile\": \"$FILE\"}," - else - tag=$(echo $FILE | sed -r -z -e 's/(\.\/)*.*\/(.+)(\.dockerfile)/-\2/gm') - MATRIX_COMBINATIONS="$MATRIX_COMBINATIONS {\"dockerfile\": \"$FILE\", \"tag\": \"$tag\"}," - fi - done - - # removes the last character (i.e. comma) - MATRIX_COMBINATIONS=${MATRIX_COMBINATIONS::-1} - - # setup matrix for later jobs - matrix=$(( - echo "{ \"include\": [$MATRIX_COMBINATIONS] }" - ) | jq -c .) - - echo $matrix - echo $matrix | jq . - echo "matrix=$matrix" >> $GITHUB_OUTPUT - - outputs: - dockerfiles: ${{ steps.find.outputs.dockerfiles }} - matrix: ${{ steps.find.outputs.matrix }} - - check_changelog: - name: Check Changelog - needs: [check_dockerfiles] - if: ${{ needs.check_dockerfiles.outputs.dockerfiles }} - runs-on: ubuntu-latest - steps: - - name: Checkout - if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} - uses: actions/checkout@v4 - - - name: Verify Changelog - id: verify_changelog - if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} - # base_ref for pull request check, ref for push - uses: LizardByte/.github/actions/verify_changelog@master - with: - token: ${{ secrets.GITHUB_TOKEN }} - outputs: - next_version: ${{ steps.verify_changelog.outputs.changelog_parser_version }} - next_version_bare: ${{ steps.verify_changelog.outputs.changelog_parser_version_bare }} - last_version: ${{ steps.verify_changelog.outputs.latest_release_tag_name }} - release_body: ${{ steps.verify_changelog.outputs.changelog_parser_description }} - - setup_release: - name: Setup Release - needs: check_changelog - runs-on: ubuntu-latest - steps: - - name: Set release details - id: release_details - env: - RELEASE_BODY: ${{ needs.check_changelog.outputs.release_body }} - run: | - # determine to create a release or not - if [[ $GITHUB_EVENT_NAME == "push" ]]; then - RELEASE=true - else - RELEASE=false - fi - - # set the release tag - COMMIT=${{ github.sha }} - if [[ $GITHUB_REF == refs/heads/master ]]; then - TAG="${{ needs.check_changelog.outputs.next_version }}" - RELEASE_NAME="${{ needs.check_changelog.outputs.next_version }}" - RELEASE_BODY="$RELEASE_BODY" - PRE_RELEASE="false" - elif [[ $GITHUB_REF == refs/heads/nightly ]]; then - TAG="nightly-dev" - RELEASE_NAME="nightly" - RELEASE_BODY="automated nightly release - $(date -u +'%Y-%m-%dT%H:%M:%SZ') - ${COMMIT}" - PRE_RELEASE="true" - fi - - echo "create_release=${RELEASE}" >> $GITHUB_OUTPUT - echo "release_tag=${TAG}" >> $GITHUB_OUTPUT - echo "release_commit=${COMMIT}" >> $GITHUB_OUTPUT - echo "release_name=${RELEASE_NAME}" >> $GITHUB_OUTPUT - echo "pre_release=${PRE_RELEASE}" >> $GITHUB_OUTPUT - - # this is stupid but works for multiline strings - echo "RELEASE_BODY<> $GITHUB_ENV - echo "$RELEASE_BODY" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - outputs: - create_release: ${{ steps.release_details.outputs.create_release }} - release_tag: ${{ steps.release_details.outputs.release_tag }} - release_commit: ${{ steps.release_details.outputs.release_commit }} - release_name: ${{ steps.release_details.outputs.release_name }} - release_body: ${{ env.RELEASE_BODY }} - pre_release: ${{ steps.release_details.outputs.pre_release }} - - lint_dockerfile: - needs: [check_dockerfiles] - if: ${{ needs.check_dockerfiles.outputs.dockerfiles }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.check_dockerfiles.outputs.matrix) }} - name: Lint Dockerfile${{ matrix.tag }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Hadolint - id: hadolint - uses: hadolint/hadolint-action@v3.1.0 - with: - dockerfile: ${{ matrix.dockerfile }} - ignore: DL3008,DL3013,DL3016,DL3018,DL3028,DL3059 - output-file: ./hadolint.log - verbose: true - - - name: Log - if: failure() - run: | - echo "Hadolint outcome: ${{ steps.hadolint.outcome }}" >> $GITHUB_STEP_SUMMARY - cat "./hadolint.log" >> $GITHUB_STEP_SUMMARY - - docker: - needs: [check_dockerfiles, check_changelog, setup_release] - if: ${{ needs.check_dockerfiles.outputs.dockerfiles }} - runs-on: ubuntu-latest - permissions: - packages: write - contents: write - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.check_dockerfiles.outputs.matrix) }} - name: Docker${{ matrix.tag }} - - steps: - - name: Maximize build space - uses: easimon/maximize-build-space@v8 - with: - root-reserve-mb: 30720 # https://github.com/easimon/maximize-build-space#caveats - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - remove-codeql: 'true' - remove-docker-images: 'true' - - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Prepare - id: prepare - env: - NV: ${{ needs.check_changelog.outputs.next_version }} - run: | - # get branch name - BRANCH=${GITHUB_HEAD_REF} - - RELEASE=false - - if [ -z "$BRANCH" ]; then - echo "This is a PUSH event" - BRANCH=${{ github.ref_name }} - COMMIT=${{ github.sha }} - CLONE_URL=${{ github.event.repository.clone_url }} - if [[ $BRANCH == "master" ]]; then - RELEASE=true - fi - else - echo "This is a PULL REQUEST event" - COMMIT=${{ github.event.pull_request.head.sha }} - CLONE_URL=${{ github.event.pull_request.head.repo.clone_url }} - fi - - # determine to push image to dockerhub and ghcr or not - if [[ $GITHUB_EVENT_NAME == "push" ]]; then - PUSH=true - else - PUSH=false - fi - - # setup the tags - REPOSITORY=${{ github.repository }} - BASE_TAG=$(echo $REPOSITORY | tr '[:upper:]' '[:lower:]') - - TAGS="${BASE_TAG}:${COMMIT:0:7}${{ matrix.tag }},ghcr.io/${BASE_TAG}:${COMMIT:0:7}${{ matrix.tag }}" - - if [[ $GITHUB_REF == refs/heads/master ]]; then - TAGS="${TAGS},${BASE_TAG}:latest${{ matrix.tag }},ghcr.io/${BASE_TAG}:latest${{ matrix.tag }}" - TAGS="${TAGS},${BASE_TAG}:master${{ matrix.tag }},ghcr.io/${BASE_TAG}:master${{ matrix.tag }}" - elif [[ $GITHUB_REF == refs/heads/nightly ]]; then - TAGS="${TAGS},${BASE_TAG}:nightly${{ matrix.tag }},ghcr.io/${BASE_TAG}:nightly${{ matrix.tag }}" - else - TAGS="${TAGS},${BASE_TAG}:test${{ matrix.tag }},ghcr.io/${BASE_TAG}:test${{ matrix.tag }}" - fi - - if [[ ${NV} != "" ]]; then - TAGS="${TAGS},${BASE_TAG}:${NV}${{ matrix.tag }},ghcr.io/${BASE_TAG}:${NV}${{ matrix.tag }}" - fi - - # parse custom directives out of dockerfile - # try to get the platforms from the dockerfile custom directive, i.e. `# platforms: xxx,yyy` - # directives for PR event, i.e. not push event - if [[ ${PUSH} == "false" ]]; then - while read -r line; do - if [[ $line == "# platforms_pr: "* && $PLATFORMS == "" ]]; then - # echo the line and use `sed` to remove the custom directive - PLATFORMS=$(echo -e "$line" | sed 's/# platforms_pr: //') - elif [[ $PLATFORMS != "" ]]; then - # break while loop once all custom "PR" event directives are found - break - fi - done <"${{ matrix.dockerfile }}" - fi - # directives for all events... above directives will not be parsed if they were already found - while read -r line; do - if [[ $line == "# platforms: "* && $PLATFORMS == "" ]]; then - # echo the line and use `sed` to remove the custom directive - PLATFORMS=$(echo -e "$line" | sed 's/# platforms: //') - elif [[ $line == "# artifacts: "* && $ARTIFACTS == "" ]]; then - # echo the line and use `sed` to remove the custom directive - ARTIFACTS=$(echo -e "$line" | sed 's/# artifacts: //') - elif [[ $line == "# no-cache-filters: "* && $NO_CACHE_FILTERS == "" ]]; then - # echo the line and use `sed` to remove the custom directive - NO_CACHE_FILTERS=$(echo -e "$line" | sed 's/# no-cache-filters: //') - elif [[ $PLATFORMS != "" && $ARTIFACTS != "" && $NO_CACHE_FILTERS != "" ]]; then - # break while loop once all custom directives are found - break - fi - done <"${{ matrix.dockerfile }}" - # if PLATFORMS is blank, fall back to the legacy method of reading from the `.docker_platforms` file - if [[ $PLATFORMS == "" ]]; then - # read the platforms from `.docker_platforms` - PLATFORMS=$(<.docker_platforms) - fi - # if PLATFORMS is still blank, fall back to `linux/amd64` - if [[ $PLATFORMS == "" ]]; then - PLATFORMS="linux/amd64" - fi - - echo "branch=${BRANCH}" >> $GITHUB_OUTPUT - echo "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT - echo "commit=${COMMIT}" >> $GITHUB_OUTPUT - echo "clone_url=${CLONE_URL}" >> $GITHUB_OUTPUT - echo "release=${RELEASE}" >> $GITHUB_OUTPUT - echo "artifacts=${ARTIFACTS}" >> $GITHUB_OUTPUT - echo "no_cache_filters=${NO_CACHE_FILTERS}" >> $GITHUB_OUTPUT - echo "platforms=${PLATFORMS}" >> $GITHUB_OUTPUT - echo "push=${PUSH}" >> $GITHUB_OUTPUT - echo "tags=${TAGS}" >> $GITHUB_OUTPUT - - - name: Set Up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - id: buildx - - - name: Cache Docker Layers - uses: actions/cache@v3 - with: - path: /tmp/.buildx-cache - key: Docker-buildx${{ matrix.tag }}-${{ github.sha }} - restore-keys: | - Docker-buildx${{ matrix.tag }}- - - - name: Log in to Docker Hub - if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - - name: Log in to the Container registry - if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ secrets.GH_BOT_NAME }} - password: ${{ secrets.GH_BOT_TOKEN }} - - - name: Build artifacts - if: ${{ steps.prepare.outputs.artifacts == 'true' }} - id: build_artifacts - uses: docker/build-push-action@v5 - with: - context: ./ - file: ${{ matrix.dockerfile }} - target: artifacts - outputs: type=local,dest=artifacts - push: false - platforms: ${{ steps.prepare.outputs.platforms }} - build-args: | - BRANCH=${{ steps.prepare.outputs.branch }} - BUILD_DATE=${{ steps.prepare.outputs.build_date }} - BUILD_VERSION=${{ needs.check_changelog.outputs.next_version }} - COMMIT=${{ steps.prepare.outputs.commit }} - CLONE_URL=${{ steps.prepare.outputs.clone_url }} - RELEASE=${{ steps.prepare.outputs.release }} - tags: ${{ steps.prepare.outputs.tags }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - no-cache-filters: ${{ steps.prepare.outputs.no_cache_filters }} - - - name: Build and push - id: build - uses: docker/build-push-action@v5 - with: - context: ./ - file: ${{ matrix.dockerfile }} - push: ${{ steps.prepare.outputs.push }} - platforms: ${{ steps.prepare.outputs.platforms }} - build-args: | - BRANCH=${{ steps.prepare.outputs.branch }} - BUILD_DATE=${{ steps.prepare.outputs.build_date }} - BUILD_VERSION=${{ needs.check_changelog.outputs.next_version }} - COMMIT=${{ steps.prepare.outputs.commit }} - CLONE_URL=${{ steps.prepare.outputs.clone_url }} - RELEASE=${{ steps.prepare.outputs.release }} - tags: ${{ steps.prepare.outputs.tags }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - no-cache-filters: ${{ steps.prepare.outputs.no_cache_filters }} - - - name: Arrange Artifacts - if: ${{ steps.prepare.outputs.artifacts == 'true' }} - working-directory: artifacts - run: | - # artifacts will be in sub directories named after the docker target platform, e.g. `linux_amd64` - # so move files to the artifacts directory - # https://unix.stackexchange.com/a/52816 - find ./ -type f -exec mv -t ./ -n '{}' + - - # remove provenance file - rm -f ./provenance.json - - - name: Upload Artifacts - if: ${{ steps.prepare.outputs.artifacts == 'true' }} - uses: actions/upload-artifact@v3 - with: - name: Docker${{ matrix.tag }} - path: artifacts/ - - - name: Create/Update GitHub Release - if: ${{ needs.setup_release.outputs.create_release == 'true' && steps.prepare.outputs.artifacts == 'true' }} - uses: ncipollo/release-action@v1 - with: - name: ${{ needs.setup_release.outputs.release_name }} - tag: ${{ needs.setup_release.outputs.release_tag }} - commit: ${{ needs.setup_release.outputs.release_commit }} - artifacts: "*artifacts/*" - token: ${{ secrets.GH_BOT_TOKEN }} - allowUpdates: true - body: ${{ needs.setup_release.outputs.release_body }} - discussionCategory: announcements - prerelease: ${{ needs.setup_release.outputs.pre_release }} - - - name: Update Docker Hub Description - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_PASSWORD }} # token is not currently supported - repository: ${{ env.BASE_TAG }} - short-description: ${{ github.event.repository.description }} - readme-filepath: ./DOCKER_README.md diff --git a/.github/workflows/ci-qodana.yml b/.github/workflows/ci-qodana.yml deleted file mode 100644 index efc56349..00000000 --- a/.github/workflows/ci-qodana.yml +++ /dev/null @@ -1,292 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -name: Qodana - -on: - pull_request: - branches: [master, nightly] - types: [opened, synchronize, reopened] - push: - branches: [master, nightly] - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - qodana_initial_check: - name: Qodana Initial Check - permissions: - actions: write # required to use workflow dispatch on fork PRs - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Prepare - id: prepare - run: | - # check the branch variable - if [ "${{ github.event_name }}" == "push" ] - then - echo "This is a PUSH event" - # use the branch name - destination=${{ github.ref_name }} - target=${{ github.ref_name }} - else - echo "This is a PR event" - # use the PR number - destination=${{ github.event.pull_request.number }} - target=${{ github.event.pull_request.base.ref }} - fi - - echo "checkout_repo=$checkout_repo" >> $GITHUB_OUTPUT - echo "checkout_ref=$checkout_ref" >> $GITHUB_OUTPUT - echo "destination=$destination" >> $GITHUB_OUTPUT - echo "target=$target" >> $GITHUB_OUTPUT - - # prepare urls - base=https://${{ github.repository_owner }}.github.io - report_url=${base}/qodana-reports/${{ github.event.repository.name }}/${destination} - echo "report_url=$report_url" >> $GITHUB_OUTPUT - - # build matrix - files=$(find . -type f -iname "qodana*.yaml") - - echo "files: ${files}" - - # do not quote to keep this as a single line - echo files=${files} >> $GITHUB_OUTPUT - - MATRIX_COMBINATIONS="" - REPORTS_MARKDOWN="" - for FILE in ${files}; do - # extract the language from file name after `qodana-` and before `.yaml` - language=$(echo $FILE | sed -r -z -e 's/(\.\/)*.*\/(qodana.yaml)/default/gm') - if [[ $language != "default" ]]; then - language=$(echo $FILE | sed -r -z -e 's/(\.\/)*.*qodana-(.*).yaml/\2/gm') - fi - MATRIX_COMBINATIONS="$MATRIX_COMBINATIONS {\"file\": \"$FILE\", \"language\": \"$language\"}," - REPORTS_MARKDOWN="$REPORTS_MARKDOWN
- [${language}](${report_url}/${language})" - done - - # removes the last character (i.e. comma) - MATRIX_COMBINATIONS=${MATRIX_COMBINATIONS::-1} - - # setup matrix for later jobs - matrix=$(( - echo "{ \"include\": [$MATRIX_COMBINATIONS] }" - ) | jq -c .) - - echo $matrix - echo $matrix | jq . - echo "matrix=$matrix" >> $GITHUB_OUTPUT - - echo "reports_markdown=$REPORTS_MARKDOWN" >> $GITHUB_OUTPUT - - - name: Setup initial notification inputs - id: inputs - if: >- - startsWith(github.event_name, 'pull_request') && - steps.prepare.outputs.files != '' - run: | - # workflow logs - workflow_url_a=https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }} - workflow_url=${workflow_url_a}/actions/runs/${{ github.run_id }} - - # multiline message - message=$(cat <<- EOF - :warning: **Qodana is checking this PR** :warning: - Live results available [here](${workflow_url}) - EOF - ) - - # escape json control characters - message=$(jq -n --arg message "$message" '$message' | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g') - - secondary_inputs=$(echo '{ - "issue_message": "'"${message}"'", - "issue_message_id": "'"qodana"'", - "issue_number": "'"${{ github.event.number }}"'", - "issue_repo_owner": "'"${{ github.repository_owner }}"'", - "issue_repo_name": "'"${{ github.event.repository.name }}"'" - }' | jq -r .) - - #escape json control characters - secondary_inputs=$(jq -n --arg secondary_inputs "$secondary_inputs" '$secondary_inputs' \ - | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g') - - echo $secondary_inputs - - # secondary input as string, not JSON - # todo - change dispatch_ref to master instead of nightly - primary_inputs=$(echo '{ - "dispatch_repository": "'"${{ github.repository_owner }}/.github"'", - "dispatch_workflow": "'"dispatch-issue-comment.yml"'", - "dispatch_ref": "'"nightly"'", - "dispatch_inputs": "'"${secondary_inputs}"'" - }' | jq -c .) - - echo $primary_inputs - echo $primary_inputs | jq . - echo "primary_inputs=$primary_inputs" >> $GITHUB_OUTPUT - - - name: Workflow Dispatch - if: >- - startsWith(github.event_name, 'pull_request') && - steps.prepare.outputs.files != '' - uses: benc-uk/workflow-dispatch@v1.2.2 - continue-on-error: true # this might error if the workflow is not found, but we still want to run the next job - with: - ref: ${{ github.base_ref || github.ref_name }} # base ref for PR and branch name for push - workflow: dispatcher.yml - inputs: ${{ steps.inputs.outputs.primary_inputs }} - token: ${{ github.token }} - - outputs: - destination: ${{ steps.prepare.outputs.destination }} - target: ${{ steps.prepare.outputs.target }} - files: ${{ steps.prepare.outputs.files }} - reports_markdown: ${{ steps.prepare.outputs.reports_markdown }} - matrix: ${{ steps.prepare.outputs.matrix }} - - qodana: - if: ${{ needs.qodana_initial_check.outputs.files != '' }} - needs: [qodana_initial_check] - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.qodana_initial_check.outputs.matrix) }} - name: Qodana-Scan-${{ matrix.language }} - continue-on-error: true - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Get baseline - id: baseline - run: | - # check if destination is not an integer - if ! [[ "${{ needs.qodana_initial_check.outputs.destination }}" =~ ^[0-9]+$ ]] - then - echo "Running for a branch update" - echo "baseline_args=" >> $GITHUB_OUTPUT - else - echo "Running for a PR" - - sarif_file=qodana.sarif.json - repo=${{ github.event.repository.name }} - target=${{ needs.qodana_initial_check.outputs.target }} - language=${{ matrix.language }} - - baseline_file="${repo}/${target}/${language}/results/${sarif_file}" - baseline_file_url="https://lizardbyte.github.io/qodana-reports/${baseline_file}" - - # don't fail if file does not exist - wget ${baseline_file_url} || true - - # check if file exists - if [ -f ${sarif_file} ] - then - echo "baseline exists" - echo "baseline_args=--baseline,${sarif_file}" >> $GITHUB_OUTPUT - else - echo "baseline does not exist" - echo "baseline_args=" >> $GITHUB_OUTPUT - fi - fi - - - name: Rename Qodana config file - id: rename - run: | - # rename the file - if [ "${{ matrix.file }}" != "./qodana.yaml" ] - then - mv -f ${{ matrix.file }} ./qodana.yaml - fi - - - name: Qodana - id: qodana - continue-on-error: true # ensure dispatch-qodana job is run - uses: JetBrains/qodana-action@v2023.2.6 - with: - additional-cache-hash: ${{ github.ref }}-${{ matrix.language }} - artifact-name: qodana-${{ matrix.language }} # yamllint disable-line rule:line-length - args: '--print-problems,${{ steps.baseline.outputs.baseline_args }}' - pr-mode: false - upload-result: true - use-caches: true - - - name: Set output status - id: status - run: | - # check if qodana failed - echo "qodana_status=${{ steps.qodana.outcome }}" >> $GITHUB_OUTPUT - - outputs: - qodana_status: ${{ steps.status.outputs.qodana_status }} - - dispatch-qodana: - # trigger qodana-reports to download artifacts from the matrix runs - needs: [qodana_initial_check, qodana] - runs-on: ubuntu-latest - name: Dispatch Qodana - permissions: - actions: write # required to use workflow dispatch on fork PRs - if: ${{ needs.qodana_initial_check.outputs.files != '' }} - steps: - - name: Setup qodana publish inputs - id: inputs - run: | - # get the artifacts - artifacts=${{ toJson(steps.artifacts.outputs.result) }} - artifacts=$(echo $artifacts | jq -c .) - - # get the target branch - target=${{ needs.qodana_initial_check.outputs.target }} - - # get the destination branch - destination=${{ needs.qodana_initial_check.outputs.destination }} - - # client payload - secondary_inputs=$(echo '{ - "destination": "'"${destination}"'", - "ref": "'"${{ github.ref }}"'", - "repo": "'"${{ github.repository }}"'", - "repo_name": "'"${{ github.event.repository.name }}"'", - "run_id": "'"${{ github.run_id }}"'", - "reports_markdown": "'"${{ needs.qodana_initial_check.outputs.reports_markdown }}"'", - "status": "'"${{ needs.qodana.outputs.qodana_status }}"'" - }' | jq -r .) - - #escape json control characters - secondary_inputs=$(jq -n --arg secondary_inputs "$secondary_inputs" '$secondary_inputs' \ - | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g') - - echo $secondary_inputs - - primary_inputs=$(echo '{ - "dispatch_repository": "'"${{ github.repository_owner }}/qodana-reports"'", - "dispatch_workflow": "'"dispatch-qodana.yml"'", - "dispatch_ref": "'"master"'", - "dispatch_inputs": "'"$secondary_inputs"'" - }' | jq -c .) - - echo $primary_inputs - echo $primary_inputs | jq . - echo "primary_inputs=$primary_inputs" >> $GITHUB_OUTPUT - - - name: Workflow Dispatch - uses: benc-uk/workflow-dispatch@v1.2.2 - continue-on-error: true # this might error if the workflow is not found, but we don't want to fail the workflow - with: - ref: ${{ github.base_ref || github.ref_name }} # base ref for PR and branch name for push - workflow: dispatcher.yml - inputs: ${{ steps.inputs.outputs.primary_inputs }} - token: ${{ github.token }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 95349bbc..00000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,147 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# This workflow will analyze all supported languages in the repository using CodeQL Analysis. - -name: "CodeQL" - -on: - push: - branches: ["master", "nightly"] - pull_request: - branches: ["master", "nightly"] - schedule: - - cron: '00 12 * * 0' # every Sunday at 12:00 UTC - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - languages: - name: Get language matrix - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.lang.outputs.result }} - continue: ${{ steps.continue.outputs.result }} - steps: - - name: Get repo languages - uses: actions/github-script@v6 - id: lang - with: - script: | - // CodeQL supports ['cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift'] - // Use only 'java' to analyze code written in Java, Kotlin or both - // Use only 'javascript' to analyze code written in JavaScript, TypeScript or both - // Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - const supported_languages = ['cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift'] - - const remap_languages = { - 'c++': 'cpp', - 'c#': 'csharp', - 'kotlin': 'java', - 'typescript': 'javascript', - } - - const repo = context.repo - const response = await github.rest.repos.listLanguages(repo) - let matrix = { - "include": [] - } - - for (let [key, value] of Object.entries(response.data)) { - // remap language - if (remap_languages[key.toLowerCase()]) { - console.log(`Remapping language: ${key} to ${remap_languages[key.toLowerCase()]}`) - key = remap_languages[key.toLowerCase()] - } - if (supported_languages.includes(key.toLowerCase()) && - !matrix['include'].includes({"language": key.toLowerCase()})) { - console.log(`Found supported language: ${key}`) - matrix['include'].push({"language": key.toLowerCase()}) - } - } - - // print languages - console.log(`matrix: ${JSON.stringify(matrix)}`) - - return matrix - - - name: Continue - uses: actions/github-script@v6 - id: continue - with: - script: | - // if matrix['include'] is an empty list return false, otherwise true - const matrix = ${{ steps.lang.outputs.result }} // this is already json encoded - - if (matrix['include'].length == 0) { - return false - } else { - return true - } - - analyze: - name: Analyze - if: ${{ needs.languages.outputs.continue == 'true' }} - needs: [languages] - runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} - timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.languages.outputs.matrix) }} - - steps: - - name: Maximize build space - uses: easimon/maximize-build-space@v8 - with: - root-reserve-mb: 20480 - remove-dotnet: ${{ (matrix.language == 'csharp' && 'false') || 'true' }} - remove-android: 'true' - remove-haskell: 'true' - remove-codeql: 'false' - remove-docker-images: 'true' - - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: recursive - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # yamllint disable-line rule:line-length - # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - # Pre autobuild - # create a file named .codeql-prebuild-${{ matrix.language }}.sh in the root of your repository - - name: Prebuild - run: | - # check if .qodeql-prebuild-${{ matrix.language }}.sh exists - if [ -f "./.codeql-prebuild-${{ matrix.language }}.sh" ]; then - echo "Running .codeql-prebuild-${{ matrix.language }}.sh" - ./.codeql-prebuild-${{ matrix.language }}.sh - fi - - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{matrix.language}}" diff --git a/.github/workflows/cpp-lint.yml b/.github/workflows/cpp-lint.yml deleted file mode 100644 index 86a2b8d6..00000000 --- a/.github/workflows/cpp-lint.yml +++ /dev/null @@ -1,120 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# Lint c++ source files and cmake files. - -name: C++ Lint - -on: - pull_request: - branches: [master, nightly] - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - clang-format: - name: Clang Format Lint - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Find cpp files - id: find_files - run: | - # find files - found_files=$(find . -type f -iname "*.cpp" -o -iname "*.h" -o -iname "*.m" -o -iname "*.mm") - ignore_files=$(find . -type f -iname ".clang-format-ignore") - - # Loop through each C++ file - for file in $found_files; do - for ignore_file in $ignore_files; do - ignore_directory=$(dirname "$ignore_file") - # if directory of ignore_file is beginning of file - if [[ "$file" == "$ignore_directory"* ]]; then - echo "ignoring file: ${file}" - found_files="${found_files//${file}/}" - break 1 - fi - done - done - - # remove empty lines - found_files=$(echo "$found_files" | sed '/^\s*$/d') - - echo "found cpp files: ${found_files}" - - # do not quote to keep this as a single line - echo found_files=${found_files} >> $GITHUB_OUTPUT - - - name: Clang format lint - if: ${{ steps.find_files.outputs.found_files }} - uses: DoozyX/clang-format-lint-action@v0.16.2 - with: - source: ${{ steps.find_files.outputs.found_files }} - extensions: 'cpp,h,m,mm' - clangFormatVersion: 16 - style: file - inplace: false - - - name: Upload Artifacts - if: failure() - uses: actions/upload-artifact@v3 - with: - name: clang-format-fixes - path: ${{ steps.find_files.outputs.found_files }} - - cmake-lint: - name: CMake Lint - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools cmakelang - - - name: Find cmake files - id: find_files - run: | - # find files - found_files=$(find . -type f -iname "CMakeLists.txt" -o -iname "*.cmake") - ignore_files=$(find . -type f -iname ".cmake-lint-ignore") - - # Loop through each C++ file - for file in $found_files; do - for ignore_file in $ignore_files; do - ignore_directory=$(dirname "$ignore_file") - # if directory of ignore_file is beginning of file - if [[ "$file" == "$ignore_directory"* ]]; then - echo "ignoring file: ${file}" - found_files="${found_files//${file}/}" - break 1 - fi - done - done - - # remove empty lines - found_files=$(echo "$found_files" | sed '/^\s*$/d') - - echo "found cmake files: ${found_files}" - - # do not quote to keep this as a single line - echo found_files=${found_files} >> $GITHUB_OUTPUT - - - name: Test with cmake-lint - run: | - cmake-lint --line-width 120 --tab-size 4 ${{ steps.find_files.outputs.found_files }} diff --git a/.github/workflows/dispatcher.yml b/.github/workflows/dispatcher.yml deleted file mode 100644 index c83a233e..00000000 --- a/.github/workflows/dispatcher.yml +++ /dev/null @@ -1,69 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# This action receives a dispatch event and passes it through to another repo. This is a workaround to avoid issues -# where fork PRs do not have access to secrets. - -name: Dispatcher - -on: - workflow_dispatch: - inputs: - dispatch_repository: - description: 'Repository to dispatch to' - required: true - dispatch_workflow: - description: 'Workflow to dispatch to' - required: true - dispatch_ref: - description: 'Ref/branch to dispatch to' - required: true - dispatch_inputs: - description: 'Inputs to send' - required: true - -jobs: - dispatcher: - name: Repository Dispatch - runs-on: ubuntu-latest - steps: - - name: Unescape JSON control characters - id: inputs - run: | - # get the inputs - dispatch_inputs=${{ github.event.inputs.dispatch_inputs }} - echo "$dispatch_inputs" - - # temporarily replace newlines with a placeholder - dispatch_inputs=$(echo ${dispatch_inputs} | sed 's/\\\\n/_!new_line!_/g') - - # remove newline characters - dispatch_inputs=$(echo ${dispatch_inputs} | sed 's/\\n//g') - - # replace placeholder with newline - dispatch_inputs=$(echo ${dispatch_inputs} | sed 's/_!new_line!_/\\n/g') - - # replace escaped quotes with unescaped quotes - dispatch_inputs=$(echo ${dispatch_inputs} | sed 's/\\"//g') - - # debug echo - echo "$dispatch_inputs" - - # parse as JSON - dispatch_inputs=$(echo "$dispatch_inputs" | jq -c .) - - # debug echo - echo "$dispatch_inputs" - - echo "dispatch_inputs=$dispatch_inputs" >> $GITHUB_OUTPUT - - - name: Workflow Dispatch - uses: benc-uk/workflow-dispatch@v1.2.2 - with: - repo: ${{ github.event.inputs.dispatch_repository }} - ref: ${{ github.event.inputs.dispatch_ref || 'master' }} # default to master if not specified - workflow: ${{ github.event.inputs.dispatch_workflow }} - inputs: ${{ steps.inputs.outputs.dispatch_inputs }} - token: ${{ secrets.GH_BOT_TOKEN || github.token }} # fallback to default token if not specified diff --git a/.github/workflows/issues-stale.yml b/.github/workflows/issues-stale.yml deleted file mode 100644 index aecc8243..00000000 --- a/.github/workflows/issues-stale.yml +++ /dev/null @@ -1,61 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# Manage stale issues and PRs. - -name: Stale Issues / PRs - -on: - schedule: - - cron: '00 10 * * *' - -jobs: - stale: - name: Check Stale Issues / PRs - if: startsWith(github.repository, 'LizardByte/') - runs-on: ubuntu-latest - steps: - - name: Stale - uses: actions/stale@v8 - with: - close-issue-message: > - This issue was closed because it has been stalled for 10 days with no activity. - close-pr-message: > - This PR was closed because it has been stalled for 10 days with no activity. - days-before-stale: 90 - days-before-close: 10 - exempt-all-assignees: true - exempt-issue-labels: 'added,fixed' - exempt-pr-labels: 'dependencies,l10n' - stale-issue-label: 'stale' - stale-issue-message: > - It seems this issue hasn't had any activity in the past 90 days. - If it's still something you'd like addressed, please let us know by leaving a comment. - Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks! - stale-pr-label: 'stale' - stale-pr-message: > - It looks like this PR has been idle for 90 days. - If it's still something you're working on or would like to pursue, - please leave a comment or update your branch. - Otherwise, we'll be closing this PR in 10 days to reduce our backlog. Thanks! - repo-token: ${{ secrets.GH_BOT_TOKEN }} - - - name: Invalid Template - uses: actions/stale@v8 - with: - close-issue-message: > - This issue was closed because the the template was not completed after 5 days. - close-pr-message: > - This PR was closed because the the template was not completed after 5 days. - days-before-stale: 0 - days-before-close: 5 - only-labels: 'invalid:template-incomplete' - stale-issue-label: 'invalid:template-incomplete' - stale-issue-message: > - Invalid issues template. - stale-pr-label: 'invalid:template-incomplete' - stale-pr-message: > - Invalid PR template. - repo-token: ${{ secrets.GH_BOT_TOKEN }} diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml deleted file mode 100644 index d7a1025c..00000000 --- a/.github/workflows/issues.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# Label and un-label actions using `../label-actions.yml`. - -name: Issues - -on: - issues: - types: [labeled, unlabeled] - discussion: - types: [labeled, unlabeled] - -jobs: - label: - name: Label Actions - if: startsWith(github.repository, 'LizardByte/') - runs-on: ubuntu-latest - steps: - - name: Label Actions - uses: dessant/label-actions@v3 - with: - github-token: ${{ secrets.GH_BOT_TOKEN }} diff --git a/.github/workflows/localize.yml b/.github/workflows/localize.yml deleted file mode 100644 index eb7e7797..00000000 --- a/.github/workflows/localize.yml +++ /dev/null @@ -1,98 +0,0 @@ ---- -name: localize - -on: - push: - branches: [nightly] - paths: # prevents workflow from running unless these files change - - '.github/workflows/localize.yml' - - 'src/**' - - 'locale/sunshine.po' - workflow_dispatch: - -env: - file: ./locale/sunshine.po - -jobs: - localize: - name: Update Localization - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Python 3.9 - uses: actions/setup-python@v4 # https://github.com/actions/setup-python - with: - python-version: '3.9' - - - name: Set up Python 3.9 Dependencies - run: | - cd ./scripts - python -m pip install --upgrade pip setuptools - python -m pip install -r requirements.txt - - - name: Set up xgettext - run: | - sudo apt-get update -y && \ - sudo apt-get --reinstall install -y \ - gettext - - - name: Update Strings - run: | - # first, try to remove existing file as xgettext does not remove unused translations - if [ -f "${{ env.file }}" ]; - then - rm ${{ env.file }} - echo "new_file=false" >> $GITHUB_ENV - else - echo "new_file=true" >> $GITHUB_ENV - fi - - # extract the new strings - python ./scripts/_locale.py --extract - - - name: git diff - if: ${{ env.new_file == 'false' }} - run: | - # disable the pager - git config --global pager.diff false - - # print the git diff - git diff locale/sunshine.po - - # set the variable with minimal output, replacing `\t` with ` ` - OUTPUT=$(git diff --numstat locale/sunshine.po | sed -e "s#\t# #g") - echo "git_diff=${OUTPUT}" >> $GITHUB_ENV - - - name: git reset - # only run if a single line changed (date/time) and file already existed - if: ${{ env.git_diff == '1 1 locale/sunshine.po' && env.new_file == 'false' }} - run: | - git reset --hard - - - name: Get current date - id: date - run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT - - - name: Create/Update Pull Request - uses: peter-evans/create-pull-request@v5 - with: - add-paths: | - locale/*.po - token: ${{ secrets.GH_BOT_TOKEN }} # must trigger PR tests - commit-message: New localization template - branch: localize/update - delete-branch: true - base: nightly - title: New Babel Updates - body: | - Update report - - Updated ${{ steps.date.outputs.date }} - - Auto-generated by [create-pull-request][1] - - [1]: https://github.com/peter-evans/create-pull-request - labels: | - babel - l10n diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index c70ba0bf..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: build - -on: - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build_win: - name: Windows - runs-on: windows-2019 - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Setup Dependencies Windows - uses: msys2/setup-msys2@v2 - with: - update: true - install: >- - base-devel - diffutils - git - make - mingw-w64-x86_64-binutils - mingw-w64-x86_64-boost - mingw-w64-x86_64-cmake - mingw-w64-x86_64-curl - mingw-w64-x86_64-onevpl - mingw-w64-x86_64-nsis - mingw-w64-x86_64-openssl - mingw-w64-x86_64-opus - mingw-w64-x86_64-toolchain - nasm - wget - yasm - - - name: Build Windows - shell: msys2 {0} - run: | - mkdir build - cd build - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DSUNSHINE_ASSETS_DIR=assets \ - -G "MinGW Makefiles" \ - .. - mingw32-make diff --git a/.github/workflows/python-flake8.yml b/.github/workflows/python-flake8.yml deleted file mode 100644 index 4b0d3081..00000000 --- a/.github/workflows/python-flake8.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# Lint python files with flake8. - -name: flake8 - -on: - pull_request: - branches: [master, nightly] - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - flake8: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 # https://github.com/actions/setup-python - with: - python-version: '3.10' - - - name: Install dependencies - run: | - # pin flake8 before v6.0.0 due to removal of support for type comments (required for Python 2.7 type hints) - python -m pip install --upgrade pip setuptools "flake8<6" - - - name: Test with flake8 - run: | - python -m flake8 --verbose diff --git a/.github/workflows/release-notifier-moonlight.yml b/.github/workflows/release-notifier-moonlight.yml deleted file mode 100644 index 9ac896f3..00000000 --- a/.github/workflows/release-notifier-moonlight.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -name: Release Notifications (Moonlight) - -on: - release: - types: [published] - -jobs: - discord: - runs-on: ubuntu-latest - steps: - - name: discord - uses: sarisia/actions-status-discord@v1 # https://github.com/sarisia/actions-status-discord - with: - webhook: ${{ secrets.DISCORD_RELEASE_WEBHOOK_MOONLIGHT }} - nodetail: true - nofail: false - username: ${{ secrets.DISCORD_USERNAME }} - avatar_url: ${{ secrets.ORG_LOGO_URL }} - title: ${{ github.event.repository.name }} ${{ github.ref_name }} Released - description: ${{ github.event.release.body }} - color: 0xFF4500 diff --git a/.github/workflows/release-notifier.yml b/.github/workflows/release-notifier.yml deleted file mode 100644 index 5161fc5f..00000000 --- a/.github/workflows/release-notifier.yml +++ /dev/null @@ -1,103 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# Send release notification to various platforms. - -name: Release Notifications - -on: - release: - types: [published] - # https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onevent_nametypes - -jobs: - discord: - if: >- - (github.repository, 'LizardByte/') and - not(github.event.release.prerelease) and - not(github.event.release.draft) - runs-on: ubuntu-latest - steps: - - name: discord - uses: sarisia/actions-status-discord@v1 - with: - webhook: ${{ secrets.DISCORD_RELEASE_WEBHOOK }} - nodetail: true - nofail: false - username: ${{ secrets.DISCORD_USERNAME }} - avatar_url: ${{ secrets.ORG_LOGO_URL }} - title: ${{ github.event.repository.name }} ${{ github.ref_name }} Released - description: ${{ github.event.release.body }} - color: 0xFF4500 - - facebook_group: - if: >- - (github.repository, 'LizardByte/') and - not(github.event.release.prerelease) and - not(github.event.release.draft) - runs-on: ubuntu-latest - steps: - - name: facebook-post-action - uses: ReenigneArcher/facebook-post-action@v1 - with: - page_id: ${{ secrets.FACEBOOK_GROUP_ID }} - access_token: ${{ secrets.FACEBOOK_ACCESS_TOKEN }} - message: | - ${{ github.event.repository.name }} ${{ github.ref_name }} Released - ${{ github.event.release.body }} - url: ${{ github.event.release.html_url }} - - facebook_page: - if: >- - (github.repository, 'LizardByte/') and - not(github.event.release.prerelease) and - not(github.event.release.draft) - runs-on: ubuntu-latest - steps: - - name: facebook-post-action - uses: ReenigneArcher/facebook-post-action@v1 - with: - page_id: ${{ secrets.FACEBOOK_PAGE_ID }} - access_token: ${{ secrets.FACEBOOK_ACCESS_TOKEN }} - message: | - ${{ github.event.repository.name }} ${{ github.ref_name }} Released - ${{ github.event.release.body }} - url: ${{ github.event.release.html_url }} - - reddit: - if: >- - (github.repository, 'LizardByte/') and - not(github.event.release.prerelease) and - not(github.event.release.draft) - runs-on: ubuntu-latest - steps: - - name: reddit - uses: bluwy/release-for-reddit-action@v2 - with: - username: ${{ secrets.REDDIT_USERNAME }} - password: ${{ secrets.REDDIT_PASSWORD }} - app-id: ${{ secrets.REDDIT_CLIENT_ID }} - app-secret: ${{ secrets.REDDIT_CLIENT_SECRET }} - subreddit: ${{ secrets.REDDIT_SUBREDDIT }} - title: ${{ github.event.repository.name }} ${{ github.ref_name }} Released - url: ${{ github.event.release.html_url }} - flair-id: ${{ secrets.REDDIT_FLAIR_ID }} # https://www.reddit.com/r/>/api/link_flair.json - comment: ${{ github.event.release.body }} - - twitter: - if: >- - (github.repository, 'LizardByte/') and - not(github.event.release.prerelease) and - not(github.event.release.draft) - runs-on: ubuntu-latest - steps: - - name: twitter - uses: nearform-actions/github-action-notify-twitter@v1 - with: - message: ${{ github.event.release.html_url }} - twitter-app-key: ${{ secrets.TWITTER_API_KEY }} - twitter-app-secret: ${{ secrets.TWITTER_API_SECRET }} - twitter-access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }} - twitter-access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml new file mode 100644 index 00000000..21af8ee7 --- /dev/null +++ b/.github/workflows/ubuntu.yml @@ -0,0 +1,18 @@ +name: REMOTE +on: + workflow_dispatch: + push: + branches: [ dll ] +jobs: + build-img: + runs-on: ubuntu-latest + steps: + - name: Login + run : | + docker login -u ${{ secrets.DOCKER_REPO_USER }} -p ${{ secrets.DOCKER_REPO_PASSWORD }} + - name: Checkout repository + uses: actions/checkout@v2 + - name: build + run : | + docker build . -f ./docker/ubuntu-22.04.dockerfile -t pigeatgarlic/sunshine:dll + docker push pigeatgarlic/sunshine:dll \ No newline at end of file diff --git a/.github/workflows/update-pages.yml b/.github/workflows/update-pages.yml deleted file mode 100644 index 5fbbf97f..00000000 --- a/.github/workflows/update-pages.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -name: Build GH-Pages - -on: - pull_request: - branches: [master, nightly] - types: [opened, synchronize, reopened] - push: - branches: [master] - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - update_pages: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Checkout gh-pages - uses: actions/checkout@v4 - with: - ref: gh-pages - path: gh-pages - persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of the personal token - fetch-depth: 0 # otherwise, will fail to push refs to dest repo - - - name: Prepare gh-pages - run: | - # empty contents - rm -f -r ./gh-pages/* - - # copy template back to pages - cp -f -r ./gh-pages-template/. ./gh-pages/ - - - name: Upload Artifacts - if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} - uses: actions/upload-artifact@v3 - with: - name: gh-pages - if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` - path: | - ${{ github.workspace }}/gh-pages - !**/*.git - - - name: Deploy to gh-pages - if: >- - (github.event_name == 'push' && github.ref == 'refs/heads/master') || - (github.event_name == 'workflow_dispatch') - uses: actions-js/push@v1.4 - with: - github_token: ${{ secrets.GH_BOT_TOKEN }} - author_email: ${{ secrets.GH_BOT_EMAIL }} - author_name: ${{ secrets.GH_BOT_NAME }} - directory: gh-pages - branch: gh-pages - force: false - message: sync gh-pages to ${{ github.sha }} diff --git a/.github/workflows/yaml-lint.yml b/.github/workflows/yaml-lint.yml deleted file mode 100644 index 7e1fd469..00000000 --- a/.github/workflows/yaml-lint.yml +++ /dev/null @@ -1,66 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -# Lint yaml files. - -name: yaml lint - -on: - pull_request: - branches: [master, nightly] - types: [opened, synchronize, reopened] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - yaml-lint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Find additional files - id: find-files - run: | - # space separated list of files - FILES=.clang-format - - # empty placeholder - FOUND="" - - for FILE in ${FILES}; do - if [ -f "$FILE" ] - then - FOUND="$FOUND $FILE" - fi - done - - echo "found=${FOUND}" >> $GITHUB_OUTPUT - - - name: yaml lint - id: yaml-lint - uses: ibiqlik/action-yamllint@v3 - with: - # https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration - config_data: | - extends: default - rules: - comments: - level: error - line-length: - max: 120 - truthy: - # GitHub uses "on" for workflow event triggers - # .clang-format file has options of "Yes" "No" that will be caught by this, so changed to "warning" - allowed-values: ['true', 'false', 'on'] - check-keys: true - level: warning - file_or_dir: . ${{ steps.find-files.outputs.found }} - - - name: Log - run: | - cat "${{ steps.yaml-lint.outputs.logfile }}" >> $GITHUB_STEP_SUMMARY diff --git a/docker/archlinux.dockerfile b/docker/archlinux.dockerfile deleted file mode 100644 index 15cb5d23..00000000 --- a/docker/archlinux.dockerfile +++ /dev/null @@ -1,149 +0,0 @@ -# syntax=docker/dockerfile:1.4 -# artifacts: true -# platforms: linux/amd64 -# archlinux does not have an arm64 base image -# no-cache-filters: artifacts,sunshine -ARG BASE=archlinux -ARG TAG=base-devel -FROM ${BASE}:${TAG} AS sunshine-base - -# install dependencies -RUN <<_DEPS -#!/bin/bash -set -e -pacman -Syu --disable-download-timeout --needed --noconfirm \ - archlinux-keyring -_DEPS - -# Setup builder user, arch prevents running makepkg as root -RUN useradd -m builder && \ - echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers -# makepkg is used in sunshine-build and uploader build stages - -FROM sunshine-base as sunshine-build - -ARG BRANCH -ARG BUILD_VERSION -ARG COMMIT -ARG CLONE_URL -# note: BUILD_VERSION may be blank - -ENV BRANCH=${BRANCH} -ENV BUILD_VERSION=${BUILD_VERSION} -ENV COMMIT=${COMMIT} - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# install dependencies -# cuda, libcap, and libdrm are optional dependencies for PKGBUILD -RUN <<_DEPS -#!/bin/bash -set -e -pacman -Syu --disable-download-timeout --needed --noconfirm \ - base-devel \ - cmake \ - cuda \ - git \ - libcap \ - libdrm \ - namcap -_DEPS - -# Setup builder user -USER builder - -# copy repository -WORKDIR /build/sunshine/ -COPY --link .. . - -# setup build directory -WORKDIR /build/sunshine/build - -# configure PKGBUILD file -RUN <<_MAKE -#!/bin/bash -set -e -if [[ "${BUILD_VERSION}" == '' ]]; then - sub_version=".r${COMMIT}" -else - sub_version="" -fi -cmake \ - -DSUNSHINE_CONFIGURE_PKGBUILD=ON \ - -DSUNSHINE_SUB_VERSION="${sub_version}" \ - -DGITHUB_CLONE_URL="${CLONE_URL}" \ - -DGITHUB_BRANCH=${BRANCH} \ - -DGITHUB_BUILD_VERSION=${BUILD_VERSION} \ - -DGITHUB_COMMIT="${COMMIT}" \ - -DSUNSHINE_CONFIGURE_ONLY=ON \ - /build/sunshine -_MAKE - -WORKDIR /build/sunshine/pkg -RUN mv /build/sunshine/build/PKGBUILD . - -# namcap and build PKGBUILD file -RUN <<_PKGBUILD -#!/bin/bash -set -e -namcap -i PKGBUILD -makepkg -si --noconfirm -ls -a -_PKGBUILD - -FROM scratch as artifacts - -COPY --link --from=sunshine-build /build/sunshine/pkg/PKGBUILD /PKGBUILD -COPY --link --from=sunshine-build /build/sunshine/pkg/sunshine*.pkg.tar.zst /sunshine.pkg.tar.zst - -FROM sunshine-base as sunshine - -# copy from uploader instead of artifacts or uploader stage will not run -COPY --link --from=artifacts /sunshine.pkg.tar.zst / - -# install sunshine -RUN <<_INSTALL_SUNSHINE -#!/bin/bash -set -e -# update keyring to prevent cached keyring errors -pacman -Syu --disable-download-timeout --needed --noconfirm \ - archlinux-keyring -pacman -U --disable-download-timeout --needed --noconfirm \ - /sunshine.pkg.tar.zst -_INSTALL_SUNSHINE - -# network setup -EXPOSE 47984-47990/tcp -EXPOSE 48010 -EXPOSE 47998-48000/udp - -# setup user -ARG PGID=1000 -ENV PGID=${PGID} -ARG PUID=1000 -ENV PUID=${PUID} -ENV TZ="UTC" -ARG UNAME=lizard -ENV UNAME=${UNAME} - -ENV HOME=/home/$UNAME - -# setup user -RUN <<_SETUP_USER -#!/bin/bash -set -e -# first delete the builder user -userdel -r builder - -# then create the lizard user -groupadd -f -g "${PGID}" "${UNAME}" -useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -u "${PUID}" "${UNAME}" -mkdir -p ${HOME}/.config/sunshine -ln -s ${HOME}/.config/sunshine /config -chown -R ${UNAME} ${HOME} -_SETUP_USER - -USER ${UNAME} -WORKDIR ${HOME} - -# entrypoint -ENTRYPOINT ["/usr/bin/sunshine"] diff --git a/docker/debian-bookworm.dockerfile b/docker/debian-bookworm.dockerfile deleted file mode 100644 index 1172d35a..00000000 --- a/docker/debian-bookworm.dockerfile +++ /dev/null @@ -1,175 +0,0 @@ -# syntax=docker/dockerfile:1.4 -# artifacts: true -# platforms: linux/amd64,linux/arm64/v8 -# platforms_pr: linux/amd64 -# no-cache-filters: sunshine-base,artifacts,sunshine -ARG BASE=debian -ARG TAG=bookworm -FROM ${BASE}:${TAG} AS sunshine-base - -ENV DEBIAN_FRONTEND=noninteractive - -FROM sunshine-base as sunshine-build - -ARG TARGETPLATFORM -RUN echo "target_platform: ${TARGETPLATFORM}" - -ARG BRANCH -ARG BUILD_VERSION -ARG COMMIT -# note: BUILD_VERSION may be blank - -ENV BRANCH=${BRANCH} -ENV BUILD_VERSION=${BUILD_VERSION} -ENV COMMIT=${COMMIT} - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# install dependencies -RUN <<_DEPS -#!/bin/bash -set -e -apt-get update -y -apt-get install -y --no-install-recommends \ - build-essential \ - cmake=3.25.* \ - git \ - libavdevice-dev \ - libayatana-appindicator3-dev \ - libboost-filesystem-dev=1.74.* \ - libboost-locale-dev=1.74.* \ - libboost-log-dev=1.74.* \ - libboost-program-options-dev=1.74.* \ - libcap-dev \ - libcurl4-openssl-dev \ - libdrm-dev \ - libevdev-dev \ - libnotify-dev \ - libnuma-dev \ - libopus-dev \ - libpulse-dev \ - libssl-dev \ - libva-dev \ - libvdpau-dev \ - libwayland-dev \ - libx11-dev \ - libxcb-shm0-dev \ - libxcb-xfixes0-dev \ - libxcb1-dev \ - libxfixes-dev \ - libxrandr-dev \ - libxtst-dev \ - nodejs \ - npm \ - wget -if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then - apt-get install -y --no-install-recommends \ - libmfx-dev -fi -apt-get clean -rm -rf /var/lib/apt/lists/* -_DEPS - -# install cuda -WORKDIR /build/cuda -# versions: https://developer.nvidia.com/cuda-toolkit-archive -ENV CUDA_VERSION="12.0.0" -ENV CUDA_BUILD="525.60.13" -# hadolint ignore=SC3010 -RUN <<_INSTALL_CUDA -#!/bin/bash -set -e -cuda_prefix="https://developer.download.nvidia.com/compute/cuda/" -cuda_suffix="" -if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then - cuda_suffix="_sbsa" -fi -url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run" -echo "cuda url: ${url}" -wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run -chmod a+x ./cuda.run -./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm -rm ./cuda.run -_INSTALL_CUDA - -# copy repository -WORKDIR /build/sunshine/ -COPY --link .. . - -# setup npm dependencies -RUN npm install - -# setup build directory -WORKDIR /build/sunshine/build - -# cmake and cpack -RUN <<_MAKE -#!/bin/bash -set -e -cmake \ - -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DSUNSHINE_ASSETS_DIR=share/sunshine \ - -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ - -DSUNSHINE_ENABLE_WAYLAND=ON \ - -DSUNSHINE_ENABLE_X11=ON \ - -DSUNSHINE_ENABLE_DRM=ON \ - -DSUNSHINE_ENABLE_CUDA=ON \ - /build/sunshine -make -j "$(nproc)" -cpack -G DEB -_MAKE - -FROM scratch AS artifacts -ARG BASE -ARG TAG -ARG TARGETARCH -COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /sunshine-${BASE}-${TAG}-${TARGETARCH}.deb - -FROM sunshine-base as sunshine - -# copy deb from builder -COPY --link --from=artifacts /sunshine*.deb /sunshine.deb - -# install sunshine -RUN <<_INSTALL_SUNSHINE -#!/bin/bash -set -e -apt-get update -y -apt-get install -y --no-install-recommends /sunshine.deb -apt-get clean -rm -rf /var/lib/apt/lists/* -_INSTALL_SUNSHINE - -# network setup -EXPOSE 47984-47990/tcp -EXPOSE 48010 -EXPOSE 47998-48000/udp - -# setup user -ARG PGID=1000 -ENV PGID=${PGID} -ARG PUID=1000 -ENV PUID=${PUID} -ENV TZ="UTC" -ARG UNAME=lizard -ENV UNAME=${UNAME} - -ENV HOME=/home/$UNAME - -# setup user -RUN <<_SETUP_USER -#!/bin/bash -set -e -groupadd -f -g "${PGID}" "${UNAME}" -useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -u "${PUID}" "${UNAME}" -mkdir -p ${HOME}/.config/sunshine -ln -s ${HOME}/.config/sunshine /config -chown -R ${UNAME} ${HOME} -_SETUP_USER - -USER ${UNAME} -WORKDIR ${HOME} - -# entrypoint -ENTRYPOINT ["/usr/bin/sunshine"] diff --git a/docker/debian-bullseye.dockerfile b/docker/debian-bullseye.dockerfile deleted file mode 100644 index 6d7ebdd3..00000000 --- a/docker/debian-bullseye.dockerfile +++ /dev/null @@ -1,175 +0,0 @@ -# syntax=docker/dockerfile:1.4 -# artifacts: true -# platforms: linux/amd64,linux/arm64/v8 -# platforms_pr: linux/amd64 -# no-cache-filters: sunshine-base,artifacts,sunshine -ARG BASE=debian -ARG TAG=bullseye -FROM ${BASE}:${TAG} AS sunshine-base - -ENV DEBIAN_FRONTEND=noninteractive - -FROM sunshine-base as sunshine-build - -ARG TARGETPLATFORM -RUN echo "target_platform: ${TARGETPLATFORM}" - -ARG BRANCH -ARG BUILD_VERSION -ARG COMMIT -# note: BUILD_VERSION may be blank - -ENV BRANCH=${BRANCH} -ENV BUILD_VERSION=${BUILD_VERSION} -ENV COMMIT=${COMMIT} - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# install dependencies -RUN <<_DEPS -#!/bin/bash -set -e -apt-get update -y -apt-get install -y --no-install-recommends \ - build-essential \ - cmake=3.18.* \ - git \ - libavdevice-dev \ - libayatana-appindicator3-dev \ - libboost-filesystem-dev=1.74.* \ - libboost-locale-dev=1.74.* \ - libboost-log-dev=1.74.* \ - libboost-program-options-dev=1.74.* \ - libcap-dev \ - libcurl4-openssl-dev \ - libdrm-dev \ - libevdev-dev \ - libnotify-dev \ - libnuma-dev \ - libopus-dev \ - libpulse-dev \ - libssl-dev \ - libva-dev \ - libvdpau-dev \ - libwayland-dev \ - libx11-dev \ - libxcb-shm0-dev \ - libxcb-xfixes0-dev \ - libxcb1-dev \ - libxfixes-dev \ - libxrandr-dev \ - libxtst-dev \ - nodejs \ - npm \ - wget -if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then - apt-get install -y --no-install-recommends \ - libmfx-dev -fi -apt-get clean -rm -rf /var/lib/apt/lists/* -_DEPS - -# install cuda -WORKDIR /build/cuda -# versions: https://developer.nvidia.com/cuda-toolkit-archive -ENV CUDA_VERSION="11.8.0" -ENV CUDA_BUILD="520.61.05" -# hadolint ignore=SC3010 -RUN <<_INSTALL_CUDA -#!/bin/bash -set -e -cuda_prefix="https://developer.download.nvidia.com/compute/cuda/" -cuda_suffix="" -if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then - cuda_suffix="_sbsa" -fi -url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run" -echo "cuda url: ${url}" -wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run -chmod a+x ./cuda.run -./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm -rm ./cuda.run -_INSTALL_CUDA - -# copy repository -WORKDIR /build/sunshine/ -COPY --link .. . - -# setup npm dependencies -RUN npm install - -# setup build directory -WORKDIR /build/sunshine/build - -# cmake and cpack -RUN <<_MAKE -#!/bin/bash -set -e -cmake \ - -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DSUNSHINE_ASSETS_DIR=share/sunshine \ - -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ - -DSUNSHINE_ENABLE_WAYLAND=ON \ - -DSUNSHINE_ENABLE_X11=ON \ - -DSUNSHINE_ENABLE_DRM=ON \ - -DSUNSHINE_ENABLE_CUDA=ON \ - /build/sunshine -make -j "$(nproc)" -cpack -G DEB -_MAKE - -FROM scratch AS artifacts -ARG BASE -ARG TAG -ARG TARGETARCH -COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /sunshine-${BASE}-${TAG}-${TARGETARCH}.deb - -FROM sunshine-base as sunshine - -# copy deb from builder -COPY --link --from=artifacts /sunshine*.deb /sunshine.deb - -# install sunshine -RUN <<_INSTALL_SUNSHINE -#!/bin/bash -set -e -apt-get update -y -apt-get install -y --no-install-recommends /sunshine.deb -apt-get clean -rm -rf /var/lib/apt/lists/* -_INSTALL_SUNSHINE - -# network setup -EXPOSE 47984-47990/tcp -EXPOSE 48010 -EXPOSE 47998-48000/udp - -# setup user -ARG PGID=1000 -ENV PGID=${PGID} -ARG PUID=1000 -ENV PUID=${PUID} -ENV TZ="UTC" -ARG UNAME=lizard -ENV UNAME=${UNAME} - -ENV HOME=/home/$UNAME - -# setup user -RUN <<_SETUP_USER -#!/bin/bash -set -e -groupadd -f -g "${PGID}" "${UNAME}" -useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -u "${PUID}" "${UNAME}" -mkdir -p ${HOME}/.config/sunshine -ln -s ${HOME}/.config/sunshine /config -chown -R ${UNAME} ${HOME} -_SETUP_USER - -USER ${UNAME} -WORKDIR ${HOME} - -# entrypoint -ENTRYPOINT ["/usr/bin/sunshine"] diff --git a/docker/fedora-37.dockerfile b/docker/fedora-37.dockerfile deleted file mode 100644 index c6aa0593..00000000 --- a/docker/fedora-37.dockerfile +++ /dev/null @@ -1,173 +0,0 @@ -# syntax=docker/dockerfile:1.4 -# artifacts: true -# platforms: linux/amd64,linux/arm64/v8 -# platforms_pr: linux/amd64 -# no-cache-filters: sunshine-base,artifacts,sunshine -ARG BASE=fedora -ARG TAG=37 -FROM ${BASE}:${TAG} AS sunshine-base - -FROM sunshine-base as sunshine-build - -ARG TARGETPLATFORM -RUN echo "target_platform: ${TARGETPLATFORM}" - -ARG BRANCH -ARG BUILD_VERSION -ARG COMMIT -# note: BUILD_VERSION may be blank - -ENV BRANCH=${BRANCH} -ENV BUILD_VERSION=${BUILD_VERSION} -ENV COMMIT=${COMMIT} - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# install dependencies -# hadolint ignore=DL3041 -RUN <<_DEPS -#!/bin/bash -set -e -dnf -y update -dnf -y group install "Development Tools" -dnf -y install \ - boost-devel-1.78.* \ - cmake-3.27.* \ - gcc-12.2.* \ - gcc-c++-12.2.* \ - git \ - libappindicator-gtk3-devel \ - libcap-devel \ - libcurl-devel \ - libdrm-devel \ - libevdev-devel \ - libnotify-devel \ - libva-devel \ - libvdpau-devel \ - libX11-devel \ - libxcb-devel \ - libXcursor-devel \ - libXfixes-devel \ - libXi-devel \ - libXinerama-devel \ - libXrandr-devel \ - libXtst-devel \ - mesa-libGL-devel \ - nodejs-npm \ - numactl-devel \ - openssl-devel \ - opus-devel \ - pulseaudio-libs-devel \ - rpm-build \ - wget \ - which -if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then - dnf -y install intel-mediasdk-devel -fi -dnf clean all -rm -rf /var/cache/yum -_DEPS - -# install cuda -WORKDIR /build/cuda -# versions: https://developer.nvidia.com/cuda-toolkit-archive -ENV CUDA_VERSION="12.0.0" -ENV CUDA_BUILD="525.60.13" -# hadolint ignore=SC3010 -RUN <<_INSTALL_CUDA -#!/bin/bash -set -e -cuda_prefix="https://developer.download.nvidia.com/compute/cuda/" -cuda_suffix="" -if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then - cuda_suffix="_sbsa" -fi -url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run" -echo "cuda url: ${url}" -wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run -chmod a+x ./cuda.run -./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm -rm ./cuda.run -_INSTALL_CUDA - -# copy repository -WORKDIR /build/sunshine/ -COPY --link .. . - -# setup npm dependencies -RUN npm install - -# setup build directory -WORKDIR /build/sunshine/build - -# cmake and cpack -RUN <<_MAKE -#!/bin/bash -set -e -cmake \ - -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DSUNSHINE_ASSETS_DIR=share/sunshine \ - -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ - -DSUNSHINE_ENABLE_WAYLAND=ON \ - -DSUNSHINE_ENABLE_X11=ON \ - -DSUNSHINE_ENABLE_DRM=ON \ - -DSUNSHINE_ENABLE_CUDA=ON \ - /build/sunshine -make -j "$(nproc)" -cpack -G RPM -_MAKE - -FROM scratch AS artifacts -ARG BASE -ARG TAG -ARG TARGETARCH -COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.rpm /sunshine-${BASE}-${TAG}-${TARGETARCH}.rpm - -FROM sunshine-base as sunshine - -# copy deb from builder -COPY --link --from=artifacts /sunshine*.rpm /sunshine.rpm - -# install sunshine -RUN <<_INSTALL_SUNSHINE -#!/bin/bash -set -e -dnf -y update -dnf -y install /sunshine.rpm -dnf clean all -rm -rf /var/cache/yum -_INSTALL_SUNSHINE - -# network setup -EXPOSE 47984-47990/tcp -EXPOSE 48010 -EXPOSE 47998-48000/udp - -# setup user -ARG PGID=1000 -ENV PGID=${PGID} -ARG PUID=1000 -ENV PUID=${PUID} -ENV TZ="UTC" -ARG UNAME=lizard -ENV UNAME=${UNAME} - -ENV HOME=/home/$UNAME - -# setup user -RUN <<_SETUP_USER -#!/bin/bash -set -e -groupadd -f -g "${PGID}" "${UNAME}" -useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -u "${PUID}" "${UNAME}" -mkdir -p ${HOME}/.config/sunshine -ln -s ${HOME}/.config/sunshine /config -chown -R ${UNAME} ${HOME} -_SETUP_USER - -USER ${UNAME} -WORKDIR ${HOME} - -# entrypoint -ENTRYPOINT ["/usr/bin/sunshine"] diff --git a/docker/fedora-38.dockerfile b/docker/fedora-38.dockerfile deleted file mode 100644 index 2245ba9b..00000000 --- a/docker/fedora-38.dockerfile +++ /dev/null @@ -1,175 +0,0 @@ -# syntax=docker/dockerfile:1.4 -# artifacts: true -# platforms: linux/amd64,linux/arm64/v8 -# platforms_pr: linux/amd64 -# no-cache-filters: sunshine-base,artifacts,sunshine -ARG BASE=fedora -ARG TAG=38 -FROM ${BASE}:${TAG} AS sunshine-base - -FROM sunshine-base as sunshine-build - -ARG TARGETPLATFORM -RUN echo "target_platform: ${TARGETPLATFORM}" - -ARG BRANCH -ARG BUILD_VERSION -ARG COMMIT -# note: BUILD_VERSION may be blank - -ENV BRANCH=${BRANCH} -ENV BUILD_VERSION=${BUILD_VERSION} -ENV COMMIT=${COMMIT} - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# install dependencies -# hadolint ignore=DL3041 -RUN <<_DEPS -#!/bin/bash -set -e -dnf -y update -dnf -y group install "Development Tools" -dnf -y install \ - boost-devel-1.78.0* \ - cmake-3.27.* \ - gcc-13.2.* \ - gcc-c++-13.2.* \ - git \ - libappindicator-gtk3-devel \ - libcap-devel \ - libcurl-devel \ - libdrm-devel \ - libevdev-devel \ - libnotify-devel \ - libva-devel \ - libvdpau-devel \ - libX11-devel \ - libxcb-devel \ - libXcursor-devel \ - libXfixes-devel \ - libXi-devel \ - libXinerama-devel \ - libXrandr-devel \ - libXtst-devel \ - mesa-libGL-devel \ - nodejs-npm \ - numactl-devel \ - openssl-devel \ - opus-devel \ - pulseaudio-libs-devel \ - rpm-build \ - wget \ - which -if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then - dnf -y install intel-mediasdk-devel -fi -dnf clean all -rm -rf /var/cache/yum -_DEPS - -# todo - enable cuda once it's supported for gcc 13 and fedora 38 -## install cuda -#WORKDIR /build/cuda -## versions: https://developer.nvidia.com/cuda-toolkit-archive -#ENV CUDA_VERSION="12.0.0" -#ENV CUDA_BUILD="525.60.13" -## hadolint ignore=SC3010 -#RUN <<_INSTALL_CUDA -##!/bin/bash -#set -e -#cuda_prefix="https://developer.download.nvidia.com/compute/cuda/" -#cuda_suffix="" -#if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then -# cuda_suffix="_sbsa" -#fi -#url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run" -#echo "cuda url: ${url}" -#wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run -#chmod a+x ./cuda.run -#./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm -#rm ./cuda.run -#_INSTALL_CUDA - -# copy repository -WORKDIR /build/sunshine/ -COPY --link .. . - -# setup npm dependencies -RUN npm install - -# setup build directory -WORKDIR /build/sunshine/build - -# cmake and cpack -# todo - add cmake argument back in for cuda support "-DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \" -# todo - re-enable "DSUNSHINE_ENABLE_CUDA" -RUN <<_MAKE -#!/bin/bash -set -e -cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DSUNSHINE_ASSETS_DIR=share/sunshine \ - -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ - -DSUNSHINE_ENABLE_WAYLAND=ON \ - -DSUNSHINE_ENABLE_X11=ON \ - -DSUNSHINE_ENABLE_DRM=ON \ - -DSUNSHINE_ENABLE_CUDA=OFF \ - /build/sunshine -make -j "$(nproc)" -cpack -G RPM -_MAKE - -FROM scratch AS artifacts -ARG BASE -ARG TAG -ARG TARGETARCH -COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.rpm /sunshine-${BASE}-${TAG}-${TARGETARCH}.rpm - -FROM sunshine-base as sunshine - -# copy deb from builder -COPY --link --from=artifacts /sunshine*.rpm /sunshine.rpm - -# install sunshine -RUN <<_INSTALL_SUNSHINE -#!/bin/bash -set -e -dnf -y update -dnf -y install /sunshine.rpm -dnf clean all -rm -rf /var/cache/yum -_INSTALL_SUNSHINE - -# network setup -EXPOSE 47984-47990/tcp -EXPOSE 48010 -EXPOSE 47998-48000/udp - -# setup user -ARG PGID=1000 -ENV PGID=${PGID} -ARG PUID=1000 -ENV PUID=${PUID} -ENV TZ="UTC" -ARG UNAME=lizard -ENV UNAME=${UNAME} - -ENV HOME=/home/$UNAME - -# setup user -RUN <<_SETUP_USER -#!/bin/bash -set -e -groupadd -f -g "${PGID}" "${UNAME}" -useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -u "${PUID}" "${UNAME}" -mkdir -p ${HOME}/.config/sunshine -ln -s ${HOME}/.config/sunshine /config -chown -R ${UNAME} ${HOME} -_SETUP_USER - -USER ${UNAME} -WORKDIR ${HOME} - -# entrypoint -ENTRYPOINT ["/usr/bin/sunshine"] diff --git a/docker/ubuntu-20.04.dockerfile b/docker/ubuntu-20.04.dockerfile deleted file mode 100644 index 5634d48e..00000000 --- a/docker/ubuntu-20.04.dockerfile +++ /dev/null @@ -1,211 +0,0 @@ -# syntax=docker/dockerfile:1.4 -# artifacts: true -# platforms: linux/amd64,linux/arm64/v8 -# platforms_pr: linux/amd64 -# no-cache-filters: sunshine-base,artifacts,sunshine -ARG BASE=ubuntu -ARG TAG=20.04 -FROM ${BASE}:${TAG} AS sunshine-base - -ENV DEBIAN_FRONTEND=noninteractive - -FROM sunshine-base as sunshine-build - -ARG TARGETPLATFORM -RUN echo "target_platform: ${TARGETPLATFORM}" - -ARG BRANCH -ARG BUILD_VERSION -ARG COMMIT -# note: BUILD_VERSION may be blank - -ENV BRANCH=${BRANCH} -ENV BUILD_VERSION=${BUILD_VERSION} -ENV COMMIT=${COMMIT} - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -# install dependencies -RUN <<_DEPS -#!/bin/bash -set -e -apt-get update -y -apt-get install -y --no-install-recommends \ - build-essential \ - gcc-10=10.5.* \ - g++-10=10.5.* \ - git \ - libayatana-appindicator3-dev \ - libavdevice-dev \ - libboost-filesystem-dev=1.71.* \ - libboost-locale-dev=1.71.* \ - libboost-log-dev=1.71.* \ - libboost-program-options-dev=1.71.* \ - libcap-dev \ - libcurl4-openssl-dev \ - libdrm-dev \ - libevdev-dev \ - libnotify-dev \ - libnuma-dev \ - libopus-dev \ - libpulse-dev \ - libssl-dev \ - libva-dev \ - libvdpau-dev \ - libwayland-dev \ - libx11-dev \ - libxcb-shm0-dev \ - libxcb-xfixes0-dev \ - libxcb1-dev \ - libxfixes-dev \ - libxrandr-dev \ - libxtst-dev \ - nodejs \ - npm \ - wget -if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then - apt-get install -y --no-install-recommends \ - libmfx-dev -fi -apt-get clean -rm -rf /var/lib/apt/lists/* -_DEPS - -# Update gcc alias -# https://stackoverflow.com/a/70653945/11214013 -RUN <<_GCC_ALIAS -#!/bin/bash -set -e -update-alternatives --install \ - /usr/bin/gcc gcc /usr/bin/gcc-10 100 \ - --slave /usr/bin/g++ g++ /usr/bin/g++-10 \ - --slave /usr/bin/gcov gcov /usr/bin/gcov-10 \ - --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-10 \ - --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-10 -_GCC_ALIAS - -# install cmake -# sunshine requires cmake >= 3.18 -WORKDIR /build/cmake -# https://cmake.org/download/ -ENV CMAKE_VERSION="3.25.1" -# hadolint ignore=SC3010 -RUN <<_INSTALL_CMAKE -#!/bin/bash -set -e -cmake_prefix="https://github.com/Kitware/CMake/releases/download/v" -if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then - cmake_arch="x86_64" -elif [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then - cmake_arch="aarch64" -fi -url="${cmake_prefix}${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${cmake_arch}.sh" -echo "cmake url: ${url}" -wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cmake.sh -sh ./cmake.sh --prefix=/usr/local --skip-license -rm ./cmake.sh -_INSTALL_CMAKE - -# install cuda -WORKDIR /build/cuda -# versions: https://developer.nvidia.com/cuda-toolkit-archive -ENV CUDA_VERSION="11.8.0" -ENV CUDA_BUILD="520.61.05" -# hadolint ignore=SC3010 -RUN <<_INSTALL_CUDA -#!/bin/bash -set -e -cuda_prefix="https://developer.download.nvidia.com/compute/cuda/" -cuda_suffix="" -if [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then - cuda_suffix="_sbsa" -fi -url="${cuda_prefix}${CUDA_VERSION}/local_installers/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux${cuda_suffix}.run" -echo "cuda url: ${url}" -wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda.run -chmod a+x ./cuda.run -./cuda.run --silent --toolkit --toolkitpath=/build/cuda --no-opengl-libs --no-man-page --no-drm -rm ./cuda.run -_INSTALL_CUDA - -# copy repository -WORKDIR /build/sunshine/ -COPY --link .. . - -# setup npm dependencies -RUN npm install - -# setup build directory -WORKDIR /build/sunshine/build - -# cmake and cpack -RUN <<_MAKE -#!/bin/bash -set -e -cmake \ - -DCMAKE_CUDA_COMPILER:PATH=/build/cuda/bin/nvcc \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DSUNSHINE_ASSETS_DIR=share/sunshine \ - -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \ - -DSUNSHINE_ENABLE_WAYLAND=ON \ - -DSUNSHINE_ENABLE_X11=ON \ - -DSUNSHINE_ENABLE_DRM=ON \ - -DSUNSHINE_ENABLE_CUDA=ON \ - /build/sunshine -make -j "$(nproc)" -cpack -G DEB -_MAKE - -FROM scratch AS artifacts -ARG BASE -ARG TAG -ARG TARGETARCH -COPY --link --from=sunshine-build /build/sunshine/build/cpack_artifacts/Sunshine.deb /sunshine-${BASE}-${TAG}-${TARGETARCH}.deb - -FROM sunshine-base as sunshine - -# copy deb from builder -COPY --link --from=artifacts /sunshine*.deb /sunshine.deb - -# install sunshine -RUN <<_INSTALL_SUNSHINE -#!/bin/bash -set -e -apt-get update -y -apt-get install -y --no-install-recommends /sunshine.deb -apt-get clean -rm -rf /var/lib/apt/lists/* -_INSTALL_SUNSHINE - -# network setup -EXPOSE 47984-47990/tcp -EXPOSE 48010 -EXPOSE 47998-48000/udp - -# setup user -ARG PGID=1000 -ENV PGID=${PGID} -ARG PUID=1000 -ENV PUID=${PUID} -ENV TZ="UTC" -ARG UNAME=lizard -ENV UNAME=${UNAME} - -ENV HOME=/home/$UNAME - -# setup user -RUN <<_SETUP_USER -#!/bin/bash -set -e -groupadd -f -g "${PGID}" "${UNAME}" -useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -u "${PUID}" "${UNAME}" -mkdir -p ${HOME}/.config/sunshine -ln -s ${HOME}/.config/sunshine /config -chown -R ${UNAME} ${HOME} -_SETUP_USER - -USER ${UNAME} -WORKDIR ${HOME} - -# entrypoint -ENTRYPOINT ["/usr/bin/sunshine"]