diff options
author | PatTheMav <PatTheMav@users.noreply.github.com> | 2023-07-22 17:44:19 +0200 |
---|---|---|
committer | PatTheMav <PatTheMav@users.noreply.github.com> | 2023-07-22 18:42:15 +0200 |
commit | db58fbe53523c3de5ff4ea1e8b13e3924ca44413 (patch) | |
tree | 19931061da263d53a970aa9b3f05a6c28330d8dd | |
parent | 07d0da12d6db89cdd48f1511a0ba3e986d84e5b6 (diff) |
CI: Test release workflow jobsrelease-test
-rw-r--r-- | .github/actions/build-obs/action.yaml | 5 | ||||
-rw-r--r-- | .github/actions/qt-xml-validator/action.yaml | 2 | ||||
-rw-r--r-- | .github/actions/run-clang-format/action.yaml | 2 | ||||
-rw-r--r-- | .github/actions/run-cmake-format/action.yaml | 2 | ||||
-rw-r--r-- | .github/actions/run-swift-format/action.yaml | 2 | ||||
-rw-r--r-- | .github/actions/setup-macos-codesigning/action.yaml | 3 | ||||
-rw-r--r-- | .github/actions/steam-upload/action.yaml | 4 | ||||
-rwxr-xr-x | .github/scripts/.build.zsh | 2 | ||||
-rwxr-xr-x | .github/scripts/.package.zsh | 4 | ||||
-rw-r--r-- | .github/workflows/build-project.yaml | 7 | ||||
-rw-r--r-- | .github/workflows/push.yaml | 204 |
11 files changed, 120 insertions, 117 deletions
diff --git a/.github/actions/build-obs/action.yaml b/.github/actions/build-obs/action.yaml index c0d117fad..bda425a32 100644 --- a/.github/actions/build-obs/action.yaml +++ b/.github/actions/build-obs/action.yaml @@ -20,6 +20,10 @@ inputs: description: Team ID for application codesigning (macOS only) required: false default: '' + provisioningProfileUUID: + description: UUID of provisioning profile (macOS only) + required: false + default: '' workingDirectory: description: Working directory for packaging required: false @@ -34,6 +38,7 @@ runs: env: CODESIGN_IDENT: ${{ inputs.codesignIdent }} CODESIGN_TEAM: ${{ inputs.codesignTeam }} + PROVISIONING_PROFILE: ${{ inputs.provisioningProfileUUID }} run: | : Run macOS Build diff --git a/.github/actions/qt-xml-validator/action.yaml b/.github/actions/qt-xml-validator/action.yaml index 0dc0e1b39..5e0750435 100644 --- a/.github/actions/qt-xml-validator/action.yaml +++ b/.github/actions/qt-xml-validator/action.yaml @@ -46,6 +46,8 @@ runs: shopt -s extglob shopt -s globstar + if (( ! GITHUB_REF_BEFORE )); then GITHUB_REF_BEFORE='HEAD~1'; fi + changes=($(git diff --name-only HEAD~1 HEAD -- UI/forms/**/*.ui)) case "${GITHUB_EVENT_NAME}" in pull_request) changes=($(git diff --name-only origin/"${GITHUB_BASE_REF}" HEAD -- UI/forms/**/*.ui)) ;; diff --git a/.github/actions/run-clang-format/action.yaml b/.github/actions/run-clang-format/action.yaml index 8fa7a79ba..40eda230d 100644 --- a/.github/actions/run-clang-format/action.yaml +++ b/.github/actions/run-clang-format/action.yaml @@ -43,6 +43,8 @@ runs: : Run clang-format π if (( ${+RUNNER_DEBUG} )) setopt XTRACE + if (( ! GITHUB_REF_BEFORE )) GITHUB_REF_BEFORE='HEAD~1' + local -a changes=($(git diff --name-only HEAD~1 HEAD)) case ${GITHUB_EVENT_NAME} { pull_request) changes=($(git diff --name-only origin/${GITHUB_BASE_REF} HEAD)) ;; diff --git a/.github/actions/run-cmake-format/action.yaml b/.github/actions/run-cmake-format/action.yaml index 835fdb82b..90f738227 100644 --- a/.github/actions/run-cmake-format/action.yaml +++ b/.github/actions/run-cmake-format/action.yaml @@ -42,6 +42,8 @@ runs: : Run cmake-format ποΈ if (( ${+RUNNER_DEBUG} )) setopt XTRACE + if (( ! GITHUB_REF_BEFORE )) GITHUB_REF_BEFORE='HEAD~1' + local -a changes=($(git diff --name-only HEAD~1 HEAD)) case ${GITHUB_EVENT_NAME} { pull_request) changes=($(git diff --name-only origin/${GITHUB_BASE_REF} HEAD)) ;; diff --git a/.github/actions/run-swift-format/action.yaml b/.github/actions/run-swift-format/action.yaml index e595c3f30..62cfd7b73 100644 --- a/.github/actions/run-swift-format/action.yaml +++ b/.github/actions/run-swift-format/action.yaml @@ -42,6 +42,8 @@ runs: : Run swift-format π₯ if (( ${+RUNNER_DEBUG} )) setopt XTRACE + if (( ! GITHUB_REF_BEFORE )) GITHUB_REF_BEFORE='HEAD~1' + local -a changes=($(git diff --name-only HEAD~1 HEAD)) case ${GITHUB_EVENT_NAME} { pull_request) changes=($(git diff --name-only origin/${GITHUB_BASE_REF} HEAD)) ;; diff --git a/.github/actions/setup-macos-codesigning/action.yaml b/.github/actions/setup-macos-codesigning/action.yaml index 69ece6c33..cc325d5fa 100644 --- a/.github/actions/setup-macos-codesigning/action.yaml +++ b/.github/actions/setup-macos-codesigning/action.yaml @@ -28,6 +28,9 @@ outputs: haveProvisioningProfile: description: True if necessary provisioning profile credentials were found value: ${{ steps.provisioning.outputs.haveProvisioningProfile }} + provisioningProfileUUID: + description: UUID of imported provisioning profile + value: ${{ steps.provisioning.outputs.provisioningProfileUUID }} haveNotarizationUser: description: True if necessary notarization credentials were found value: ${{ steps.notarization.outputs.haveNotarizationUser }} diff --git a/.github/actions/steam-upload/action.yaml b/.github/actions/steam-upload/action.yaml index a149962d7..968d188ff 100644 --- a/.github/actions/steam-upload/action.yaml +++ b/.github/actions/steam-upload/action.yaml @@ -245,7 +245,7 @@ runs: steamcmd \ +login '${{ inputs.steamUser }}' '${{ inputs.steamPassword }}' '${{ steps.steam-totp.outputs.code }}' \ - +run_app_build ${preview:+-preview} ${build_file} \ + +run_app_build ${preview:+-preview} ${build_file:a} \ +quit print '::endgroup' popd @@ -275,7 +275,7 @@ runs: steamcmd \ +login '${{ inputs.steamUser }}' '${{ inputs.steamPassword }}' '${{ steps.steam-totp.outputs.code }}' \ - +run_app_build ${preview} ${build_file} \ + +run_app_build ${preview} ${build_file:a} \ +quit print '::endgroup' popd diff --git a/.github/scripts/.build.zsh b/.github/scripts/.build.zsh index 7670c880f..fbc49d0ed 100755 --- a/.github/scripts/.build.zsh +++ b/.github/scripts/.build.zsh @@ -298,7 +298,7 @@ ${_usage_host:-}" autoload -Uz run_xcodebuild pushd build_macos - if (( ${+CI} )) && [[ ${GITHUB_EVENT_NAME} == push && ${GITHUB_REF_NAME} =~ [0-9]+.[0-9]+.[0-9]+(-(rc|beta).+)? ]] { + if (( ${+CI} )) { run_xcodebuild ${archive_args} run_xcodebuild ${export_args} } else { diff --git a/.github/scripts/.package.zsh b/.github/scripts/.package.zsh index 0febfc95c..bd89d270c 100755 --- a/.github/scripts/.package.zsh +++ b/.github/scripts/.package.zsh @@ -134,8 +134,8 @@ ${_usage_host:-}" config=${2} shift 2 ;; - -s|--codesign) CODESIGN=1; shift ;; - -n|--notarize) NOTARIZE=1; shift ;; + -s|--codesign) codesign=1; shift ;; + -n|--notarize) notarize=1; shift ;; -p|--package) typeset -g package=1; shift ;; --skip-deps) typeset -g skip_deps=1; shift ;; -q|--quiet) (( verbosity -= 1 )) || true; shift ;; diff --git a/.github/workflows/build-project.yaml b/.github/workflows/build-project.yaml index bbe352a65..3921069be 100644 --- a/.github/workflows/build-project.yaml +++ b/.github/workflows/build-project.yaml @@ -37,10 +37,8 @@ jobs: ;; push) config_data=('codesign:true' 'notarize:false' 'package:true' 'config:RelWithDebInfo') - if [[ ${GITHUB_REF_NAME} =~ [0-9]+.[0-9]+.[0-9]+(-(rc|beta).+)? ]]; then - config_data[1]='notarize:true' - config_data[3]='config:Release' - fi + config_data[1]='notarize:true' + config_data[3]='config:Release' ;; workflow_dispatch) config_data=('codesign:true' 'notarize:false' 'package:false' 'config:RelWithDebInfo') @@ -139,6 +137,7 @@ jobs: codesign: ${{ fromJSON(needs.check-event.outputs.codesign) }} codesignIdent: ${{ steps.codesign.outputs.codesignIdent }} codesignTeam: ${{ steps.codesign.outputs.codesignTeam }} + provisioningProfileUUID: ${{ steps.codesign.outputs.provisioningProfileUUID }} - name: Package OBS Studio π uses: ./.github/actions/package-obs diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index dfc75c311..3556599c2 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -5,10 +5,7 @@ on: paths-ignore: - '**.md' branches: - - master - - 'release/**' - tags: - - '*' + - release-test permissions: contents: write concurrency: @@ -17,7 +14,6 @@ concurrency: jobs: check-format: name: Check Formatting π - if: github.ref_name == 'master' uses: ./.github/workflows/check-format.yaml permissions: contents: read @@ -29,110 +25,27 @@ jobs: permissions: contents: read - compatibility-validation: - name: Validate Compatibility Data π΅οΈ - if: github.ref_name == 'master' - runs-on: ubuntu-22.04 - permissions: - checks: write - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Check for Changed Files β
- uses: ./.github/actions/check-changes - id: checks - with: - baseRef: ${{ github.event.before }} - checkGlob: plugins/win-capture/data/*.json - - - name: Check for Invalid Compatibility Data π - if: fromJSON(steps.checks.outputs.hasChangedFiles) - uses: ./.github/actions/compatibility-validator - with: - repositorySecret: ${{ github.token }} - - services-validation: - name: Validate Service Data π΅οΈ - if: github.ref_name == 'master' - runs-on: ubuntu-22.04 - permissions: - checks: write - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Check for Changed Files β
- uses: ./.github/actions/check-changes - id: checks - with: - baseRef: ${{ github.event.before }} - checkGlob: plugins/rtmp-services/data/*.json - - - name: Check Services JSON Schema π - if: fromJSON(steps.checks.outputs.hasChangedFiles) - uses: ./.github/actions/services-validator - with: - repositorySecret: ${{ github.token }} - runSchemaChecks: true - runServiceChecks: false - - upload-language-files: - name: Upload Language Files π - if: github.repository_owner == 'obsproject' && github.ref_name == 'master' - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - fetch-depth: 0 - - - name: Check for Changed Files β
- uses: ./.github/actions/check-changes - id: checks - with: - baseRef: ${{ github.event.before }} - checkGlob: '**/en-US.ini' - - - name: Upload US English Language Files πΊπΈ - if: fromJSON(steps.checks.outputs.hasChangedFiles) - uses: obsproject/obs-crowdin-sync/upload@0.2.1 - env: - CROWDIN_PAT: ${{ secrets.CROWDIN_SYNC_CROWDIN_PAT }} - GITHUB_EVENT_BEFORE: ${{ github.event.before }} - update-documentation: name: Update Documentation π - if: github.repository_owner == 'obsproject' && (github.ref_name == 'master' || github.ref_type == 'tag') runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Check for Changed Files β
- if: github.ref_name != 'tag' - uses: ./.github/actions/check-changes - id: checks - with: - baseRef: ${{ github.event.before }} - checkGlob: '!(cmake*)' - - uses: ./.github/actions/generate-docs - if: github.ref_type == 'tag' || fromJSON(steps.checks.outputs.hasChangedFiles) with: - disableLinkExtensions: ${{ github.ref_type == 'tag' }} + disableLinkExtensions: true deploy-documentation: name: Deploy Documentation to Cloudflare βοΈ - if: github.repository_owner == 'obsproject' && github.ref_type == 'tag' runs-on: ubuntu-22.04 needs: update-documentation defaults: run: shell: bash + environment: + name: cf-pages-deploy steps: - name: Get Commit Information π id: setup @@ -159,11 +72,10 @@ jobs: workingDirectory: docs apiToken: ${{ secrets.CF_API_TOKEN }} accountId: ${{ secrets.CF_ACCOUNT_ID }} - command: pages publish . --project-name=${{ vars.CF_PAGES_PROJECT }} --commit-hash='${{ steps.setup.outputs.commitHash }}' + command: pages publish . --project-name=${{ vars.CF_PAGES_PROJECT }} --commit-hash='${{ steps.setup.outputs.commitHash }}' --dry-run create-appcast: name: Create Sparkle Appcast ποΈ - if: github.repository_owner == 'obsproject' && github.ref_type == 'tag' runs-on: macos-13 needs: build-project strategy: @@ -221,7 +133,6 @@ jobs: create-release: name: Create Release π« - if: github.ref_type == 'tag' runs-on: ubuntu-22.04 needs: build-project defaults: @@ -296,18 +207,95 @@ jobs: echo " ${file##*/}: $(sha256sum "${file}" | cut -d " " -f 1)" >> ${{ github.workspace }}/CHECKSUMS.txt done - - name: Create Release π« - if: fromJSON(steps.check.outputs.validTag) - id: create_release - uses: softprops/action-gh-release@d4e8205d7e959a9107da6396278b2f1f07af0f9b + echo "$(<CHECKSUMS.txt)" + + flatpak-publish: + name: Publish to Flathub π¦ + needs: create-release + runs-on: ubuntu-22.04 + defaults: + run: + shell: bash + env: + FLATPAK_BUILD_PATH: flatpak_app/files/share + container: + image: bilelmoussaoui/flatpak-github-actions:kde-6.4 + options: --privileged + strategy: + matrix: + branch: ${{ fromJSON('["beta", "stable"]') }} + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + fetch-depth: 0 + set-safe-directory: ${{ github.workspace }} + + - name: Set Up Environment π§ + id: setup + env: + GH_TOKEN: ${{ github.token }} + run: | + : Set Up Environment π§ + if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi + + git config --global --add safe.directory "${GITHUB_WORKSPACE}" + + dnf install -y -q gh + gh extension install actions/gh-actions-cache + + cache_key='flatpak-builder-${{ hashFiles('build-aux/**/*.json') }}' + cache_ref='master' + read -r key size unit _ ref _ <<< \ + "$(gh actions-cache list -B ${cache_ref} --key "${cache_key}-x86_64" | head -1)" + + if [[ "${key}" ]]; then + echo "cacheHit=true" >> $GITHUB_OUTPUT + else + echo "cacheHit=false" >> $GITHUB_OUTPUT + fi + + echo "cacheKey=${cache_key}" >> $GITHUB_OUTPUT + echo "commitHash=$(git rev-parse --short=9 HEAD)" >> $GITHUB_OUTPUT + + - name: Build Flatpak Manifest + uses: flatpak/flatpak-github-actions/flatpak-builder@v6.1 + with: + bundle: obs-studio-${{ steps.setup.outputs.commitHash }}.flatpak + manifest-path: ${{ github.workspace }}/build-aux/com.obsproject.Studio.json + cache: ${{ fromJSON(steps.setup.outputs.cacheHit) }} + cache-key: ${{ steps.setup.outputs.cacheKey }} + mirror-screenshots-url: https://dl.flathub.org/repo/screenshots + branch: ${{ matrix.branch }} + + - name: Validate AppStream + working-directory: ${{ env.FLATPAK_BUILD_PATH }} + run: | + : Validate AppStream + appstream-util validate appdata/com.obsproject.Studio.appdata.xml + + - name: Verify Icon and Metadata in app-info + working-directory: ${{ env.FLATPAK_BUILD_PATH }} + run: | + : Verify Icon and Metadata in app-info + test -f app-info/icons/flatpak/128x128/com.obsproject.Studio.png || { echo "Missing 128x128 icon in app-info!"; exit 1; } + test -f app-info/xmls/com.obsproject.Studio.xml.gz || { echo "Missing com.obsproject.Studio.xml.gz in app-info!"; exit 1; } + + - name: Commit Screenshots to OSTree Repository + run: | + : Commit Screenshots to OSTree Repository + ostree commit --repo=repo --canonical-permissions --branch=screenshots/x86_64 flatpak_app/screenshots + + steam-upload: + name: Upload Steam Builds π + needs: create-release + runs-on: macos-13 + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/steam-upload with: - draft: true - prerelease: ${{ fromJSON(steps.check.outputs.prerelease) }} - tag_name: ${{ steps.check.outputs.version }} - name: OBS Studio ${{ steps.check.outputs.version }} - body_path: ${{ github.workspace }}/CHECKSUMS.txt - files: | - ${{ github.workspace }}/OBS-Studio-${{ steps.check.outputs.version }}-macOS-*.dmg - ${{ github.workspace }}/OBS-Studio-${{ steps.check.outputs.version }}-macOS-*-dSYMs.tar.xz - ${{ github.workspace }}/OBS-Studio-${{ steps.check.outputs.version }}-Ubuntu-*.deb - ${{ github.workspace }}/OBS-Studio-${{ steps.check.outputs.version }}-Ubuntu-*.ddeb + steamSecret: ${{ secrets.STEAM_SHARED_SECRET }} + steamUser: ${{ secrets.STEAM_USER }} + steamPassword: ${{ secrets.STEAM_PASSWORD }} + workflowSecret: ${{ github.token }} + preview: true |