From 8b93db0841bc35ec2f3057172385929c885acc05 Mon Sep 17 00:00:00 2001 From: Vitor K Date: Thu, 6 Apr 2023 09:34:35 -0300 Subject: [PATCH] Updates to github actions (#6358) --- .ci/common/post-upload.sh | 8 +-- .ci/windows-msvc/upload.ps1 | 4 +- .github/workflows/ci.yml | 30 +++------- .github/workflows/publish.yml | 8 +-- CMakeModules/GenerateSCMRev.cmake | 30 ++++------ bitrise.yml | 99 ------------------------------- src/citra_qt/Info.plist | 80 ++++++++++++------------- src/common/CMakeLists.txt | 11 ---- 8 files changed, 70 insertions(+), 200 deletions(-) delete mode 100644 bitrise.yml diff --git a/.ci/common/post-upload.sh b/.ci/common/post-upload.sh index 10b100685..27d92d8bd 100755 --- a/.ci/common/post-upload.sh +++ b/.ci/common/post-upload.sh @@ -10,13 +10,13 @@ cp -r dist/scripting "$REV_NAME" tar $COMPRESSION_FLAGS "$ARCHIVE_NAME" "$REV_NAME" # Find out what release we are building -if [ -z $GIT_TAG_NAME ]; then - RELEASE_NAME=head -else - RELEASE_NAME=$(echo $GIT_TAG_NAME | cut -d- -f1) +if [[ "$GITHUB_REF_NAME" =~ ^canary- ]] || [[ "$GITHUB_REF_NAME" =~ ^nightly- ]]; then + RELEASE_NAME=$(echo $GITHUB_REF_NAME | cut -d- -f1) if [ "$NAME" = "linux-mingw" ]; then RELEASE_NAME="${RELEASE_NAME}-mingw" fi +else + RELEASE_NAME=head fi mv "$REV_NAME" $RELEASE_NAME diff --git a/.ci/windows-msvc/upload.ps1 b/.ci/windows-msvc/upload.ps1 index 0fbe649a7..b2a203905 100644 --- a/.ci/windows-msvc/upload.ps1 +++ b/.ci/windows-msvc/upload.ps1 @@ -3,8 +3,8 @@ $GITDATE = $(git show -s --date=short --format='%ad') -replace "-", "" $GITREV = $(git show -s --format='%h') # Find out what release we are building -if ( $GIT_TAG_NAME ) { - $RELEASE_NAME = ${GIT_TAG_NAME}.split("-")[0] +if ( $env:GITHUB_REF_NAME -like "*canary-*" -or $env:GITHUB_REF_NAME -like "*nightly-*" ) { + $RELEASE_NAME = ${env:GITHUB_REF_NAME}.split("-")[0] $RELEASE_NAME = "${RELEASE_NAME}-msvc" } else { diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67a00dfaf..c6e5545aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,9 +40,6 @@ jobs: key: ${{ runner.os }}-${{ matrix.image }}-${{ github.sha }} restore-keys: | ${{ runner.os }}-${{ matrix.image }}- - - name: Query tag name - uses: little-core-labs/get-git-tag@v3.0.2 - id: tagName - name: Build run: ./.ci/${{ matrix.image }}/docker.sh env: @@ -88,9 +85,6 @@ jobs: key: ${{ runner.os }}-macos-${{ matrix.arch }}-${{ github.sha }} restore-keys: | ${{ runner.os }}-macos-${{ matrix.arch }}- - - name: Query tag name - uses: little-core-labs/get-git-tag@v3.0.2 - id: tagName - name: Install dependencies run: ./.ci/macos/deps.sh - name: Build @@ -113,9 +107,6 @@ jobs: - uses: actions/checkout@v3 with: submodules: recursive - - name: Query tag name - uses: little-core-labs/get-git-tag@v3.0.2 - id: tagName - name: Download x86 build uses: actions/download-artifact@master with: @@ -154,9 +145,6 @@ jobs: key: ${{ runner.os }}-win-${{ github.sha }} restore-keys: | ${{ runner.os }}-win- - - name: Query tag name - uses: little-core-labs/get-git-tag@v3.0.2 - id: tagName - name: Install dependencies run: ./.ci/windows-msvc/deps.sh shell: bash @@ -190,9 +178,12 @@ jobs: key: ${{ runner.os }}-android-${{ github.sha }} restore-keys: | ${{ runner.os }}-android- - - name: Query tag name - uses: little-core-labs/get-git-tag@v3.0.2 - id: tagName + - name: Set tag name + run: | + if [[ "$GITHUB_REF_NAME" =~ ^canary- ]] || [[ "$GITHUB_REF_NAME" =~ ^nightly- ]]; then + echo "GIT_TAG_NAME=$GITHUB_REF_NAME" >> $GITHUB_ENV + fi + echo $GIT_TAG_NAME - name: Deps run: | sudo apt-get update @@ -229,20 +220,17 @@ jobs: if: ${{ startsWith(github.ref, 'refs/tags/') }} steps: - uses: actions/download-artifact@v3 - - name: Query tag name - uses: little-core-labs/get-git-tag@v3.0.2 - id: tagName - name: Create release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ steps.tagName.outputs.tag }} - release_name: ${{ steps.tagName.outputs.tag }} + tag_name: ${{ github.ref_name }} + release_name: ${{ github.ref_name }} draft: false prerelease: false - name: Upload artifacts - uses: alexellis/upload-assets@0.2.3 + uses: alexellis/upload-assets@0.4.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 388f3556b..4c46597f4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,7 +24,7 @@ jobs: name: Pre-checkout with: submodules: false - - uses: actions/github-script@v5 + - uses: actions/github-script@v6 id: check-changes name: 'Check for new changes' env: @@ -46,7 +46,7 @@ jobs: fetch-depth: 0 submodules: true token: ${{ secrets.ALT_GITHUB_TOKEN }} - - uses: actions/github-script@v5 + - uses: actions/github-script@v6 name: 'Update and tag new commits' if: ${{ steps.check-changes.outputs.result == 'true' }} env: @@ -66,7 +66,7 @@ jobs: name: Pre-checkout with: submodules: false - - uses: actions/github-script@v5 + - uses: actions/github-script@v6 id: check-changes name: 'Check for new changes' env: @@ -87,7 +87,7 @@ jobs: fetch-depth: 0 submodules: true token: ${{ secrets.ALT_GITHUB_TOKEN }} - - uses: actions/github-script@v5 + - uses: actions/github-script@v6 name: 'Check and merge canary changes' if: ${{ steps.check-changes.outputs.result == 'true' }} env: diff --git a/CMakeModules/GenerateSCMRev.cmake b/CMakeModules/GenerateSCMRev.cmake index a011c6cbf..2dc409881 100644 --- a/CMakeModules/GenerateSCMRev.cmake +++ b/CMakeModules/GenerateSCMRev.cmake @@ -23,13 +23,7 @@ set(BUILD_VERSION "0") if (DEFINED ENV{CI}) if (DEFINED ENV{GITHUB_ACTIONS}) set(BUILD_REPOSITORY $ENV{GITHUB_REPOSITORY}) - set(BUILD_TAG $ENV{GIT_TAG_NAME}) - elseif(DEFINED ENV{APPVEYOR}) - set(BUILD_REPOSITORY $ENV{APPVEYOR_REPO_NAME}) - set(BUILD_TAG $ENV{APPVEYOR_REPO_TAG_NAME}) - elseif(DEFINED ENV{BITRISE_IO}) - set(BUILD_REPOSITORY "$ENV{BITRISEIO_GIT_REPOSITORY_OWNER}/$ENV{BITRISEIO_GIT_REPOSITORY_SLUG}") - set(BUILD_TAG $ENV{BITRISE_GIT_TAG}) + set(BUILD_TAG $ENV{GITHUB_REF_NAME}) endif() # regex capture the string nightly or canary into CMAKE_MATCH_1 @@ -43,18 +37,16 @@ if (DEFINED ENV{CI}) string(TOUPPER ${FIRST_LETTER} FIRST_LETTER) set(REPO_NAME "${REPO_NAME}${FIRST_LETTER}${REMAINDER}") endforeach() - if (BUILD_TAG) - string(REGEX MATCH "${CMAKE_MATCH_1}-([0-9]+)" OUTVAR ${BUILD_TAG}) - if (${CMAKE_MATCH_COUNT} GREATER 0) - set(BUILD_VERSION ${CMAKE_MATCH_1}) - endif() - if (BUILD_VERSION) - # This leaves a trailing space on the last word, but we actually want that - # because of how it's styled in the title bar. - set(BUILD_FULLNAME "${REPO_NAME} ${BUILD_VERSION} ") - else() - set(BUILD_FULLNAME "") - endif() + string(REGEX MATCH "${CMAKE_MATCH_1}-([0-9]+)" OUTVAR ${BUILD_TAG}) + if (${CMAKE_MATCH_COUNT} GREATER 0) + set(BUILD_VERSION ${CMAKE_MATCH_1}) + endif() + if (BUILD_VERSION) + # This leaves a trailing space on the last word, but we actually want that + # because of how it's styled in the title bar. + set(BUILD_FULLNAME "${REPO_NAME} ${BUILD_VERSION} ") + else() + set(BUILD_FULLNAME "") endif() endif() endif() diff --git a/bitrise.yml b/bitrise.yml deleted file mode 100644 index 271858f9a..000000000 --- a/bitrise.yml +++ /dev/null @@ -1,99 +0,0 @@ ---- -format_version: '11' -default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git -project_type: android -trigger_map: -- push_branch: "*" - workflow: primary -- pull_request_source_branch: "*" - workflow: primary -- tag: "*" - workflow: deploy -workflows: - deploy: - steps: - - activate-ssh-key@4: {} - - git-clone@6: {} - - cache-pull@2: {} - - script@1: - title: Install newer cmake - inputs: - - content: |- - #!/bin/bash - set -ex - sdkmanager --install "cmake;3.18.1" - - install-missing-android-tools@2.3: - inputs: - - gradlew_path: "$PROJECT_LOCATION/gradlew" - - android-lint@0: - inputs: - - project_location: "$PROJECT_LOCATION" - - module: "$MODULE" - - variant: "$BUILD_VARIANT" - - android-build@0: - inputs: - - variant: "$BUILD_VARIANT" - - project_location: "$PROJECT_LOCATION" - - build_type: aab - - sign-apk@1: - run_if: '{{getenv "BITRISEIO_ANDROID_KEYSTORE_URL" | ne ""}}' - - bitrise-step-export-universal-apk@0: - run_if: '{{getenv "BITRISEIO_ANDROID_KEYSTORE_URL" | ne ""}}' - - generate-changelog@0: {} - - github-release@0: - run_if: '{{getenv "GITHUB_API_TOKEN" | ne ""}}' - inputs: - - api_token: "$GITHUB_API_TOKEN" - - name: "$BITRISE_GIT_TAG" - - body: "$BITRISE_CHANGELOG" - - files_to_upload: |- - $BITRISE_AAB_PATH|citra-$BITRISE_GIT_TAG.aab - $BITRISE_APK_PATH|citra-$BITRISE_GIT_TAG.apk - - username: "$BITRISEIO_GIT_REPOSITORY_OWNER" - - deploy-to-bitrise-io@1.3: - run_if: '{{getenv "BITRISEIO_ANDROID_KEYSTORE_URL" | ne ""}}' - - cache-push@2: {} - - deploy-to-bitrise-io@2: {} - primary: - steps: - - activate-ssh-key@4: {} - - git-clone@6: {} - - cache-pull@2: {} - - script@1: - title: Deps - inputs: - - content: |- - #!/bin/bash - set -ex - sdkmanager --install "cmake;3.18.1" - - install-missing-android-tools@3: - inputs: - - gradlew_path: "$PROJECT_LOCATION/gradlew" - - android-lint@0: - inputs: - - project_location: "$PROJECT_LOCATION" - - module: "$MODULE" - - variant: "$BUILD_VARIANT" - - android-build@1: - inputs: - - variant: "$BUILD_VARIANT" - - project_location: "$PROJECT_LOCATION" - - build_type: apk - - cache-push@2: {} - - deploy-to-bitrise-io@2: {} -meta: - bitrise.io: - stack: linux-docker-android-20.04 -app: - envs: - - opts: - is_expand: false - PROJECT_LOCATION: src/android - - opts: - is_expand: false - MODULE: app - - opts: - is_expand: false - BUILD_VARIANT: Release - - opts: - is_expand: false diff --git a/src/citra_qt/Info.plist b/src/citra_qt/Info.plist index 73db548c6..5ab69f3d0 100644 --- a/src/citra_qt/Info.plist +++ b/src/citra_qt/Info.plist @@ -2,45 +2,45 @@ - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleGetInfoString - - CFBundleIconFile - citra.icns - CFBundleIdentifier - com.citra-emu.citra - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - - CFBundleName - Citra - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - - CSResourcesFileMapped - - LSRequiresCarbon - - NSHumanReadableCopyright - - NSPrincipalClass - NSApplication - NSHighResolutionCapable - True - NSCameraUsageDescription - This app requires camera access to emulate the 3DS's cameras. - NSMicrophoneUsageDescription - This app requires microphone access to emulate the 3DS's microphone. - LSApplicationCategoryType - public.app-category.games + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleGetInfoString + + CFBundleIconFile + citra.icns + CFBundleIdentifier + com.citra-emu.citra + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + + CFBundleName + Citra + CFBundlePackageType + APPL + CFBundleShortVersionString + + CFBundleSignature + ???? + CFBundleVersion + + CSResourcesFileMapped + + LSRequiresCarbon + + NSHumanReadableCopyright + + NSPrincipalClass + NSApplication + NSHighResolutionCapable + True + NSCameraUsageDescription + This app requires camera access to emulate the 3DS's cameras. + NSMicrophoneUsageDescription + This app requires microphone access to emulate the 3DS's microphone. + LSApplicationCategoryType + public.app-category.games diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index d0c8f9f63..b3635a747 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -3,15 +3,6 @@ # could affect the result, but much more unlikely than the following files. Keeping a list of files # like this allows for much better caching since it doesn't force the user to recompile binary shaders every update set(VIDEO_CORE "${CMAKE_SOURCE_DIR}/src/video_core") -if (DEFINED ENV{CI}) - if (DEFINED ENV{TRAVIS}) - set(BUILD_REPOSITORY $ENV{TRAVIS_REPO_SLUG}) - set(BUILD_TAG $ENV{TRAVIS_TAG}) - elseif(DEFINED ENV{APPVEYOR}) - set(BUILD_REPOSITORY $ENV{APPVEYOR_REPO_NAME}) - set(BUILD_TAG $ENV{APPVEYOR_REPO_TAG_NAME}) - endif() -endif() # Pass the path to git to the GenerateSCMRev.cmake as well find_package(Git QUIET) @@ -19,8 +10,6 @@ find_package(Git QUIET) add_custom_command(OUTPUT scm_rev.cpp COMMAND ${CMAKE_COMMAND} -DSRC_DIR="${CMAKE_SOURCE_DIR}" - -DBUILD_REPOSITORY="${BUILD_REPOSITORY}" - -DBUILD_TAG="${BUILD_TAG}" -DGIT_EXECUTABLE="${GIT_EXECUTABLE}" -P "${CMAKE_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake" DEPENDS