feat: optimize implementation of OutputRunMode::updateOutputSets() #1001
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| branches: | |
| - master | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| os: | |
| - windows-latest | |
| - ubuntu-latest | |
| - ubuntu-24.04-arm | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash | |
| outputs: | |
| tag_name: ${{ steps.release-variables.outputs.tag_name }} | |
| steps: | |
| - name: Setup Platform Variables | |
| id: platform-variables | |
| run: | | |
| case ${{ matrix.os }} in | |
| windows-latest) | |
| echo jdk_os=windows >> "$GITHUB_OUTPUT" | |
| echo jdk_arch=x64 >> "$GITHUB_OUTPUT" | |
| echo jdk_archive_type=zip >> "$GITHUB_OUTPUT" | |
| echo dist_os=windows >> "$GITHUB_OUTPUT" | |
| echo dist_arch=x86-64 >> "$GITHUB_OUTPUT" | |
| echo dist_archive_extension=zip >> "$GITHUB_OUTPUT" | |
| echo gradle_task=distZip >> "$GITHUB_OUTPUT" | |
| ;; | |
| ubuntu-latest) | |
| echo jdk_os=linux-glibc >> "$GITHUB_OUTPUT" | |
| echo jdk_arch=x64 >> "$GITHUB_OUTPUT" | |
| echo jdk_archive_type=tar.gz >> "$GITHUB_OUTPUT" | |
| echo dist_os=linux >> "$GITHUB_OUTPUT" | |
| echo dist_arch=x86-64 >> "$GITHUB_OUTPUT" | |
| echo dist_archive_extension=tgz >> "$GITHUB_OUTPUT" | |
| echo gradle_task=distTar >> "$GITHUB_OUTPUT" | |
| ;; | |
| ubuntu-24.04-arm) | |
| echo jdk_os=linux-glibc >> "$GITHUB_OUTPUT" | |
| echo jdk_arch=aarch64 >> "$GITHUB_OUTPUT" | |
| echo jdk_archive_type=tar.gz >> "$GITHUB_OUTPUT" | |
| echo dist_os=linux >> "$GITHUB_OUTPUT" | |
| echo dist_arch=aarch64 >> "$GITHUB_OUTPUT" | |
| echo dist_archive_extension=tgz >> "$GITHUB_OUTPUT" | |
| echo gradle_task=distTar >> "$GITHUB_OUTPUT" | |
| ;; | |
| *) | |
| exit 1 | |
| ;; | |
| esac | |
| - name: Setup Gradle Init Script | |
| run: | | |
| mkdir -p $HOME/.gradle | |
| cat << 'EOF' > "$HOME/.gradle/init.gradle.kts" | |
| allprojects { | |
| val baseUrl = uri("https://maven.bwravencl.de") | |
| val user = "github" | |
| val pass = "${{ secrets.MAVEN_TOKEN_SECRET }}" | |
| buildscript { | |
| repositories { | |
| maven { | |
| url = baseUrl.resolve("releases") | |
| credentials { | |
| username = user | |
| password = pass | |
| } | |
| mavenContent { releasesOnly() } | |
| } | |
| maven { | |
| url = baseUrl.resolve("snapshots") | |
| credentials { | |
| username = user | |
| password = pass | |
| } | |
| mavenContent { snapshotsOnly() } | |
| } | |
| } | |
| } | |
| repositories { | |
| maven { | |
| url = baseUrl.resolve("releases") | |
| credentials { | |
| username = user | |
| password = pass | |
| } | |
| mavenContent { releasesOnly() } | |
| } | |
| maven { | |
| url = baseUrl.resolve("snapshots") | |
| credentials { | |
| username = user | |
| password = pass | |
| } | |
| mavenContent { snapshotsOnly() } | |
| } | |
| } | |
| } | |
| EOF | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| submodules: true | |
| - name: Build Distribution Archive | |
| uses: ./.github/actions/run-gradle-task | |
| with: | |
| task: ${{ steps.platform-variables.outputs.gradle_task }} | |
| - name: Setup Release Variables | |
| id: release-variables | |
| run: | | |
| archive_path=$(find build/distributions/ControllerBuddy-*.${{ steps.platform-variables.outputs.dist_archive_extension }} -maxdepth 1 -type f -print0) | |
| echo "archive_path=$archive_path" >> "$GITHUB_OUTPUT" | |
| echo "archive_filename=$(basename "$archive_path")" >> "$GITHUB_OUTPUT" | |
| echo "tag_name=$(basename -s .${{ steps.platform-variables.outputs.dist_archive_extension }} "$archive_path" | sed "s/^ControllerBuddy-//;s/${{ steps.platform-variables.outputs.dist_os }}-${{ steps.platform-variables.outputs.dist_arch }}-//")" >> "$GITHUB_OUTPUT" | |
| - name: Upload Archive Artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: ${{ steps.release-variables.outputs.archive_filename }} | |
| path: ${{ steps.release-variables.outputs.archive_path }} | |
| if-no-files-found: error | |
| - name: Import GPG Key | |
| uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7 | |
| with: | |
| gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} | |
| - name: Sign Archive | |
| id: sign-archive | |
| run: | | |
| signature_path="${{ steps.release-variables.outputs.archive_path }}.sig" | |
| gpg --local-user 8590BB74C0F559F8AC911C1D8058553A1FD36B23 --pinentry-mode loopback --passphrase ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} --detach-sig --output "$signature_path" --yes ${{ steps.release-variables.outputs.archive_path }} | |
| echo "signature_path=$signature_path" >> "$GITHUB_OUTPUT" | |
| echo "signature_filename=$(basename "$signature_path")" >> "$GITHUB_OUTPUT" | |
| - name: Upload Signature Artifact | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: ${{ steps.sign-archive.outputs.signature_filename }} | |
| path: ${{ steps.sign-archive.outputs.signature_path }} | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 | |
| - name: Collect Artifact Files | |
| id: collect-files | |
| run: | | |
| files=$(find . -iname 'ControllerBuddy-*' -mindepth 2 -maxdepth 2 -type f) | |
| if [ -z "$files" ] | |
| then | |
| echo "Error: No artifact files found." | |
| exit 1 | |
| fi | |
| echo "files<<EOF" >> "$GITHUB_OUTPUT" | |
| while IFS= read -r line | |
| do | |
| echo "$line" >> "$GITHUB_OUTPUT" | |
| done <<< "$files" | |
| echo "EOF" >> "$GITHUB_OUTPUT" | |
| - name: Check Tag | |
| uses: action-pack/tag-exists@1466626d5e0263063b314d09d032be2daa603a6a # v1 | |
| id: check-tag | |
| with: | |
| tag: ${{ needs.build.outputs.tag_name }} | |
| - name: Tag Commit | |
| if: steps.check-tag.outputs.exists == 'false' | |
| uses: tvdias/github-tagger@ed7350546e3e503b5e942dffd65bc8751a95e49d # v0.0.2 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| tag: ${{ needs.build.outputs.tag_name }} | |
| - name: Release | |
| uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3 | |
| with: | |
| name: ControllerBuddy-${{ needs.build.outputs.tag_name }} | |
| tag_name: ${{ needs.build.outputs.tag_name }} | |
| draft: false | |
| prerelease: false | |
| files: ${{ steps.collect-files.outputs.files }} | |
| - name: Trigger Release Monitoring Check | |
| run: | | |
| sleep 20 | |
| curl -X POST https://release-monitoring.org/api/v2/versions/ -H "Authorization: token ${{ secrets.RELEASE_MONITORING_TOKEN }}" -H 'Content-Type: application/json' -d '{"id": "376393", "dry_run": "false"}' |