From 34720ff33f9c54b5292c5ae5a5cc85e1e1db1ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 7 Oct 2024 21:13:37 +0200 Subject: [PATCH 1/4] Checkout changelog.txt --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c36637b1f..84f5c09c59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -538,6 +538,11 @@ jobs: needs: [get_artifact_name, linux-portable, android, linux-appimage, macos-universal, windows] if: startsWith(github.ref, 'refs/tags/v') steps: + - name: Checkout + uses: actions/checkout@v4 + with: + sparse-checkout: | + distribution/changelog.txt - name: Download artifacts uses: actions/download-artifact@v4 with: From b24990080eb2484ff823c8ffb5a453a82af9e0a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 7 Oct 2024 19:46:43 +0200 Subject: [PATCH 2/4] Do releases in binaries repo --- .github/workflows/ci.yml | 128 +++++++++++++++++++++++++-------------- 1 file changed, 82 insertions(+), 46 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84f5c09c59..25e875daf3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ concurrency: cancel-in-progress: true jobs: - get_artifact_name: + build_variables: name: Get version info runs-on: ubuntu-latest outputs: @@ -39,12 +39,21 @@ jobs: short-sha: ${{ steps.ghd.outputs.short-sha }} distance: ${{ steps.ghd.outputs.distance }} tag: ${{ steps.ghd.outputs.tag }} + push: ${{ steps.setenv.outputs.push }} steps: + # We need to fetch entire repo to get the tags and correctly run `describe` - name: Check out code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Git describe id: ghd uses: proudust/gh-describe@v2 + - name: Set env + id: setenv + run: | + . scripts/setenv -q + echo "push=$OPENRCT2_PUSH" >> $GITHUB_OUTPUT lint-commit: name: Lint Commit Message if: github.event_name == 'pull_request' @@ -86,7 +95,7 @@ jobs: g2dat: name: g2.dat runs-on: ubuntu-latest - needs: get_artifact_name + needs: build_variables steps: - name: Checkout OpenRCT2 uses: actions/checkout@v4 @@ -104,12 +113,12 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: g2-${{ needs.get_artifact_name.outputs.name }}.dat + name: g2-${{ needs.build_variables.outputs.name }}.dat path: g2.dat windows: name: Windows runs-on: windows-latest - needs: [check-code-formatting, get_artifact_name] + needs: [check-code-formatting, build_variables] strategy: fail-fast: false matrix: @@ -139,26 +148,26 @@ jobs: build-installer -i - name: Rename artifacts run: | - mv artifacts/openrct2-portable-*.zip artifacts/OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-windows-portable-$PLATFORM.zip - mv artifacts/openrct2-installer-*.exe artifacts/OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-windows-installer-$PLATFORM.exe - mv artifacts/openrct2-symbols-*.zip artifacts/OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-windows-symbols-$PLATFORM.zip + mv artifacts/openrct2-portable-*.zip artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-windows-portable-$PLATFORM.zip + mv artifacts/openrct2-installer-*.exe artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-windows-installer-$PLATFORM.exe + mv artifacts/openrct2-symbols-*.zip artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-windows-symbols-$PLATFORM.zip - name: Upload portable artifact (CI) uses: actions/upload-artifact@v4 with: - name: OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-${{ runner.os }}-portable-${{ matrix.platform }} - path: artifacts/OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-windows-portable-${{ matrix.platform }}.zip + name: OpenRCT2-${{ needs.build_variables.outputs.name }}-${{ runner.os }}-portable-${{ matrix.platform }} + path: artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-windows-portable-${{ matrix.platform }}.zip if-no-files-found: error - name: Upload installer artifact (CI) uses: actions/upload-artifact@v4 with: - name: OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-${{ runner.os }}-installer-${{ matrix.platform }} - path: artifacts/OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-windows-installer-${{ matrix.platform }}.exe + name: OpenRCT2-${{ needs.build_variables.outputs.name }}-${{ runner.os }}-installer-${{ matrix.platform }} + path: artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-windows-installer-${{ matrix.platform }}.exe if-no-files-found: error - name: Upload symbols artifact (CI) uses: actions/upload-artifact@v4 with: - name: OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-${{ runner.os }}-symbols-${{ matrix.platform }} - path: artifacts/OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-windows-symbols-${{ matrix.platform }}.zip + name: OpenRCT2-${{ needs.build_variables.outputs.name }}-${{ runner.os }}-symbols-${{ matrix.platform }} + path: artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-windows-symbols-${{ matrix.platform }}.zip if-no-files-found: error - name: Run Tests if: matrix.platform != 'arm64' @@ -172,17 +181,17 @@ jobs: run: | . scripts/setenv if [[ "$OPENRCT2_PUSH" == "true" ]]; then - upload-build artifacts/OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-windows-portable-$PLATFORM.zip "windows-portable-$PLATFORM.zip" $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH - upload-build artifacts/OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-windows-installer-$PLATFORM.exe "windows-installer-$PLATFORM.exe" $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH - upload-build artifacts/OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-windows-symbols-$PLATFORM.zip "windows-symbols-$PLATFORM.zip" $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH - upload-backtrace-symbols artifacts/OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-windows-symbols-*.zip + upload-build artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-windows-portable-$PLATFORM.zip "windows-portable-$PLATFORM.zip" $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH + upload-build artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-windows-installer-$PLATFORM.exe "windows-installer-$PLATFORM.exe" $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH + upload-build artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-windows-symbols-$PLATFORM.zip "windows-symbols-$PLATFORM.zip" $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH + upload-backtrace-symbols artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-windows-symbols-*.zip else echo 'Not going to push build' fi windows-mingw: name: Windows (${{ matrix.platform_name }}) using mingw runs-on: ubuntu-latest - needs: [check-code-formatting, get_artifact_name] + needs: [check-code-formatting, build_variables] container: openrct2/openrct2-build:14-mingw strategy: fail-fast: false @@ -212,7 +221,7 @@ jobs: if: matrix.platform == 'NT5.1' uses: actions/upload-artifact@v4 with: - name: OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-Windows-mingw-${{ matrix.platform }} + name: OpenRCT2-${{ needs.build_variables.outputs.name }}-Windows-mingw-${{ matrix.platform }} path: bin/openrct2.exe if-no-files-found: error macos-cmake: @@ -278,7 +287,7 @@ jobs: macos-universal: name: macOS universal app bundle runs-on: macos-14 - needs: [macos-cmake, get_artifact_name] + needs: [macos-cmake, build_variables] steps: - name: Checkout uses: actions/checkout@v4 @@ -306,25 +315,25 @@ jobs: mv macos_universal/OpenRCT2-universal.app artifacts/OpenRCT2.app echo -e "\033[0;36mCompressing OpenRCT2.app...\033[0m" cd artifacts - zip -rqy OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-macos-universal.zip OpenRCT2.app + zip -rqy OpenRCT2-${{ needs.build_variables.outputs.name }}-macos-universal.zip OpenRCT2.app - name: Upload artifacts (CI) uses: actions/upload-artifact@v4 with: - name: OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-${{ runner.os }}-universal - path: artifacts/OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-macos-universal.zip + name: OpenRCT2-${{ needs.build_variables.outputs.name }}-${{ runner.os }}-universal + path: artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-macos-universal.zip if-no-files-found: error - name: Upload artifacts (openrct2.org) run: | . scripts/setenv if [[ "$OPENRCT2_PUSH" == "true" ]]; then - upload-build artifacts/OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-macos-universal.zip macos-universal.zip $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH + upload-build artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-macos-universal.zip macos-universal.zip $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH else echo 'Not going to push build' fi linux-portable: name: ${{ matrix.distro }} Linux (${{ matrix.release }}, ${{ matrix.platform }}, portable) runs-on: ubuntu-latest - needs: [check-code-formatting, get_artifact_name] + needs: [check-code-formatting, build_variables] container: ${{ matrix.image }} strategy: fail-fast: false @@ -357,11 +366,11 @@ jobs: . scripts/setenv -q && build -DWITH_TESTS=on -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DPORTABLE=ON ${{ matrix.build_flags }} strip bin/install/usr/bin/libopenrct2.so - name: Build artifacts - run: . scripts/setenv -q && build-portable artifacts/OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-${{ runner.os }}-${{ matrix.release }}-${{ matrix.platform }}.tar.gz bin/install/usr + run: . scripts/setenv -q && build-portable artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-${{ runner.os }}-${{ matrix.release }}-${{ matrix.platform }}.tar.gz bin/install/usr - name: Upload artifacts (CI) uses: actions/upload-artifact@v4 with: - name: OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-${{ runner.os }}-${{ matrix.release }}-${{ matrix.platform }} + name: OpenRCT2-${{ needs.build_variables.outputs.name }}-${{ runner.os }}-${{ matrix.release }}-${{ matrix.platform }} path: artifacts if-no-files-found: error - name: Run Tests @@ -371,14 +380,14 @@ jobs: # Build identification code: https://github.com/Limetric/OpenRCT2.org/blob/e5b738f3dadcc5a3b78e8dfd434756ff31eaa1d3/src/misc/releaseAsset.js#L94-L116 . scripts/setenv -q if [[ "$OPENRCT2_PUSH" == "true" ]]; then - upload-build artifacts/OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-${{ runner.os }}-${{ matrix.release }}-${{ matrix.platform }}.tar.gz linux-${{ matrix.platform }}-${{ matrix.distro }}.tar.gz $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH + upload-build artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-${{ runner.os }}-${{ matrix.release }}-${{ matrix.platform }}.tar.gz linux-${{ matrix.platform }}-${{ matrix.distro }}.tar.gz $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH else echo 'Not going to push build' fi linux-appimage: name: Ubuntu Linux (AppImage, x86_64) runs-on: ubuntu-latest - needs: [check-code-formatting, get_artifact_name] + needs: [check-code-formatting, build_variables] container: openrct2/openrct2-build:14-jammy steps: - name: Checkout @@ -397,12 +406,12 @@ jobs: strip bin/install/usr/bin/openrct2 - name: Build AppImage env: - APPIMAGE_FILE_NAME: OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-linux-x86_64.AppImage + APPIMAGE_FILE_NAME: OpenRCT2-${{ needs.build_variables.outputs.name }}-linux-x86_64.AppImage run: . scripts/setenv -q && build-appimage - name: Upload artifacts (CI) uses: actions/upload-artifact@v4 with: - name: OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-AppImage + name: OpenRCT2-${{ needs.build_variables.outputs.name }}-AppImage path: artifacts if-no-files-found: error - name: Upload artifacts (openrct2.org) @@ -410,7 +419,7 @@ jobs: # Build identification code: https://github.com/Limetric/OpenRCT2.org/blob/e5b738f3dadcc5a3b78e8dfd434756ff31eaa1d3/src/misc/releaseAsset.js#L94-L116 . scripts/setenv -q if [[ "$OPENRCT2_PUSH" == "true" ]]; then - upload-build artifacts/OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-linux-x86_64.AppImage linux.AppImage $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH + upload-build artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-linux-x86_64.AppImage linux.AppImage $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH else echo 'Not going to push build' fi @@ -458,7 +467,7 @@ jobs: linux-clang-tests: name: Ubuntu Linux (debug) using clang, coverage enabled runs-on: ubuntu-latest - needs: [check-code-formatting, get_artifact_name] + needs: [check-code-formatting, build_variables] container: openrct2/openrct2-build:16-noble steps: - name: Checkout @@ -490,7 +499,7 @@ jobs: - name: Upload artifacts (CI) uses: actions/upload-artifact@v4 with: - name: OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-${{ runner.os }}-coverage + name: OpenRCT2-${{ needs.build_variables.outputs.name }}-${{ runner.os }}-coverage path: | bin/*profdata* bin/coverage.json* @@ -499,7 +508,7 @@ jobs: android: name: Android runs-on: ubuntu-latest - needs: [check-code-formatting, get_artifact_name] + needs: [check-code-formatting, build_variables] container: openrct2/openrct2-build:14-android steps: - name: Checkout @@ -517,26 +526,25 @@ jobs: ./gradlew app:assembleRelease popd mkdir -p artifacts - mv src/openrct2-android/app/build/outputs/apk/release/app-release.apk artifacts/OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-android-arm.apk + mv src/openrct2-android/app/build/outputs/apk/release/app-release.apk artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-android-arm.apk - name: Upload artifacts (CI) uses: actions/upload-artifact@v4 with: - name: OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-Android + name: OpenRCT2-${{ needs.build_variables.outputs.name }}-Android path: artifacts if-no-files-found: error - name: Upload artifacts (openrct2.org) run: | . scripts/setenv -q if [[ "$OPENRCT2_PUSH" == "true" ]]; then - upload-build artifacts/OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-android-arm.apk android-arm.apk $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH + upload-build artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-android-arm.apk android-arm.apk $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH else echo 'Not going to push build' fi release: name: Release runs-on: ubuntu-latest - needs: [get_artifact_name, linux-portable, android, linux-appimage, macos-universal, windows] - if: startsWith(github.ref, 'refs/tags/v') + needs: [build_variables, linux-portable, android, linux-appimage, macos-universal, windows] steps: - name: Checkout uses: actions/checkout@v4 @@ -551,21 +559,49 @@ jobs: run: | ls -lR pushd ${{ github.workspace }} - sha1sum OpenRCT2-* > openrct2-${{ needs.get_artifact_name.outputs.name }}-sha1sums.txt + sha1sum OpenRCT2-* > OpenRCT2-${{ needs.build_variables.outputs.name }}-sha1sums.txt popd - name: Create release notes run: | + # Print all the lines until an empty line + sed -n '1,/^$/p' distribution/changelog.txt >> release_notes.txt + echo "" >> release_notes.txt + echo "SHA1 checksums:" >> release_notes.txt echo "\`\`\`" >> release_notes.txt - cat openrct2-${{ needs.get_artifact_name.outputs.name }}-sha1sums.txt >> release_notes.txt + cat OpenRCT2-${{ needs.build_variables.outputs.name }}-sha1sums.txt >> release_notes.txt echo "\`\`\`" >> release_notes.txt echo "" >> release_notes.txt - - name: Create release + # Only upload tagged releases, mark them as draft for manual verification + - name: Create tagged release uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/v') with: draft: true files: | - openrct2-${{ needs.get_artifact_name.outputs.name }}-sha1sums.txt - OpenRCT2-${{ needs.get_artifact_name.outputs.name }}-* + OpenRCT2-${{ needs.build_variables.outputs.name }}-sha1sums.txt + OpenRCT2-${{ needs.build_variables.outputs.name }}-* body_path: release_notes.txt - tag_name: ${{ needs.get_artifact_name.outputs.tag }} + tag_name: ${{ needs.build_variables.outputs.tag }} + # The upload to binaries repository is done from develop only + - name: Create tag for binaries repository + uses: actions/github-script@v5 + if: ${{ needs.build_variables.outputs.push }} + with: + github-token: ${{ secrets.OPENRCT2_BINARIES_CI_UPLOAD }} + script: | + github.rest.git.createRef({ + owner: 'OpenRCT2', + repo: 'OpenRCT2-binaries', + ref: 'refs/tags/${{ needs.build_variables.outputs.name }}', + sha: '2032e1601f3b35d07f088758d34bedbb84868616' + }) + - name: Create release in binaries repo + uses: softprops/action-gh-release@v2 + if: ${{ needs.build_variables.outputs.push }} + with: + files: | + openrct2-${{ needs.build_variables.outputs.name }}-sha1sums.txt + OpenRCT2-${{ needs.build_variables.outputs.name }}-* + body_path: release_notes.txt + tag_name: ${{ needs.build_variables.outputs.name }} From 1ae9bf2c26986cd27ec9091f6ff1b7cca1eba997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Tue, 8 Oct 2024 11:41:50 +0200 Subject: [PATCH 3/4] Update artifact name --- .github/workflows/ci.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25e875daf3..e6ace01085 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,8 @@ jobs: name: Get version info runs-on: ubuntu-latest outputs: - name: ${{ steps.ghd.outputs.describe }} + name: ${{ steps.artifact-name.outputs.name }} + describe: ${{ steps.ghd.outputs.describe }} short-sha: ${{ steps.ghd.outputs.short-sha }} distance: ${{ steps.ghd.outputs.distance }} tag: ${{ steps.ghd.outputs.tag }} @@ -46,14 +47,32 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + # We cannot use proudust/gh-describe, as it reports incorrect (too short) short-sha - name: Git describe id: ghd - uses: proudust/gh-describe@v2 + run: | + TAG=$(git describe --abbrev=0 --tags) + DESCRIBE=$(git describe --tags) + SHORT_SHA=$(git rev-parse --short HEAD) + DISTANCE=$(git rev-list --count $TAG..HEAD) + echo "tag=$TAG" >> $GITHUB_OUTPUT + echo "describe=$DESCRIBE" >> $GITHUB_OUTPUT + echo "short-sha=$SHORT_SHA" >> $GITHUB_OUTPUT + echo "distance=$DISTANCE" >> $GITHUB_OUTPUT - name: Set env id: setenv run: | . scripts/setenv -q echo "push=$OPENRCT2_PUSH" >> $GITHUB_OUTPUT + # Name is very similar to "describe", but skips the "v" prefix + - name: Get artifact name + id: artifact-name + run: | + if [ ${{ steps.ghd.outputs.distance }} -eq 0 ]; then + echo "name=${{ env.OPENRCT2_VERSION }}" >> $GITHUB_OUTPUT + else + echo "name=${{ env.OPENRCT2_VERSION }}-${{ steps.ghd.outputs.distance }}-${{ steps.ghd.outputs.short-sha }}" >> $GITHUB_OUTPUT + fi lint-commit: name: Lint Commit Message if: github.event_name == 'pull_request' From ad0f703ca828c60add6dcecabbbb9a7ed8d1a980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Thu, 10 Oct 2024 23:33:33 +0200 Subject: [PATCH 4/4] Remove old upload code to prevent uploading twice As we now upload in dedicated job to our own repo without any intermediary, there's no need to keep the upload-build script nor the steps executing it --- .github/workflows/ci.yml | 41 ++--------------------------------- scripts/upload-build | 47 ---------------------------------------- 2 files changed, 2 insertions(+), 86 deletions(-) delete mode 100755 scripts/upload-build diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6ace01085..f27f3ec26e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -196,16 +196,13 @@ jobs: with: paths: "artifacts/test-**.xml" if: matrix.platform != 'arm64' - - name: Upload artifacts (openrct2.org) + - name: Upload symbols (backtrace.io) run: | . scripts/setenv if [[ "$OPENRCT2_PUSH" == "true" ]]; then - upload-build artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-windows-portable-$PLATFORM.zip "windows-portable-$PLATFORM.zip" $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH - upload-build artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-windows-installer-$PLATFORM.exe "windows-installer-$PLATFORM.exe" $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH - upload-build artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-windows-symbols-$PLATFORM.zip "windows-symbols-$PLATFORM.zip" $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH upload-backtrace-symbols artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-windows-symbols-*.zip else - echo 'Not going to push build' + echo 'Not going to push build' fi windows-mingw: name: Windows (${{ matrix.platform_name }}) using mingw @@ -341,14 +338,6 @@ jobs: name: OpenRCT2-${{ needs.build_variables.outputs.name }}-${{ runner.os }}-universal path: artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-macos-universal.zip if-no-files-found: error - - name: Upload artifacts (openrct2.org) - run: | - . scripts/setenv - if [[ "$OPENRCT2_PUSH" == "true" ]]; then - upload-build artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-macos-universal.zip macos-universal.zip $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH - else - echo 'Not going to push build' - fi linux-portable: name: ${{ matrix.distro }} Linux (${{ matrix.release }}, ${{ matrix.platform }}, portable) runs-on: ubuntu-latest @@ -394,15 +383,6 @@ jobs: if-no-files-found: error - name: Run Tests run: . scripts/setenv -q && run-tests - - name: Upload artifacts (openrct2.org) - run: | - # Build identification code: https://github.com/Limetric/OpenRCT2.org/blob/e5b738f3dadcc5a3b78e8dfd434756ff31eaa1d3/src/misc/releaseAsset.js#L94-L116 - . scripts/setenv -q - if [[ "$OPENRCT2_PUSH" == "true" ]]; then - upload-build artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-${{ runner.os }}-${{ matrix.release }}-${{ matrix.platform }}.tar.gz linux-${{ matrix.platform }}-${{ matrix.distro }}.tar.gz $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH - else - echo 'Not going to push build' - fi linux-appimage: name: Ubuntu Linux (AppImage, x86_64) runs-on: ubuntu-latest @@ -433,15 +413,6 @@ jobs: name: OpenRCT2-${{ needs.build_variables.outputs.name }}-AppImage path: artifacts if-no-files-found: error - - name: Upload artifacts (openrct2.org) - run: | - # Build identification code: https://github.com/Limetric/OpenRCT2.org/blob/e5b738f3dadcc5a3b78e8dfd434756ff31eaa1d3/src/misc/releaseAsset.js#L94-L116 - . scripts/setenv -q - if [[ "$OPENRCT2_PUSH" == "true" ]]; then - upload-build artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-linux-x86_64.AppImage linux.AppImage $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH - else - echo 'Not going to push build' - fi linux-docker: name: Ubuntu Linux (Docker) needs: check-code-formatting @@ -552,14 +523,6 @@ jobs: name: OpenRCT2-${{ needs.build_variables.outputs.name }}-Android path: artifacts if-no-files-found: error - - name: Upload artifacts (openrct2.org) - run: | - . scripts/setenv -q - if [[ "$OPENRCT2_PUSH" == "true" ]]; then - upload-build artifacts/OpenRCT2-${{ needs.build_variables.outputs.name }}-android-arm.apk android-arm.apk $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH - else - echo 'Not going to push build' - fi release: name: Release runs-on: ubuntu-latest diff --git a/scripts/upload-build b/scripts/upload-build deleted file mode 100755 index 5dbb4dc37c..0000000000 --- a/scripts/upload-build +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [[ "$#" -ne 4 && "$#" -ne 5 ]]; then - echo 'Upload an OpenRCT2 build to openrct2.org.' - echo '' - echo 'Usage: upload-build []' - echo 'Flavours: windows-portable-x86, windows-portable-x64' - echo ' windows-installer-x86, windows-installer-x64' - echo ' windows-symbols-x86, windows-symbols-x64' - echo ' macos' - echo ' linux-i686, linux-x86_64' - echo ' android-arm, android-x86' - echo '' - echo 'Environment variable ''OPENRCT2_ORG_TOKEN'' must be set.' - exit 1 -fi - -path=$1 -flavour=$2 -version=$3 -sha1=$4 -branch=$5 - -if [ -n "$branch" ]; then - versionextra=-$branch-${sha1::10} -fi -filename=OpenRCT2-$version$versionextra-$flavour - -echo -e "\033[0;36mUploading to openrct2.org as '$filename'..." -if [ -z "$OPENRCT2_ORG_TOKEN" ]; then - echo -e "\033[0;31mOPENRCT2_ORG_TOKEN not set" - exit 1 -fi -# Use HTTP1.1 as a workaround for curl bug: -# https://github.com/actions/runner-images/issues/7329 -# https://github.com/curl/curl/issues/10591 -curl --include -m 300 --connect-timeout 5 -o - \ - --http1.1 \ - --form "key=$OPENRCT2_ORG_TOKEN" \ - --form "fileName=$filename" \ - --form "version=$version" \ - --form "gitHash=$sha1" \ - --form "gitBranch=$branch" \ - --form "file=@$path" \ - "https://openrct2.org/altapi/?command=push-build"