From e567061e3c4ff81ac1f81d026123aec00a71b329 Mon Sep 17 00:00:00 2001 From: Nik Date: Thu, 27 Oct 2022 13:19:06 +0200 Subject: [PATCH] git: Added automatic pushing of nightlies to Steam (#801) * build: Upload nightly releases to steam * git: Fixed build CI syntax * git: Try fixing steam login * git: Try steam TOTP login * git: Fix steam-deploy branch * git: Don't upload MacOS No-GPU version to Steam * git: Added commit hash to steam nightlies, only upload on our repo * git: Use full commit hash in steam nightly description * git: Fixed workflow * git: Make sure macOS doesn't upload steam releases when it shouldn't * git: Fix macos CI again * git: Use steam-deploy fork to fix Linux deployment --- .github/workflows/build.yml | 64 +++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9325f3e1f..5ebf344d1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -120,6 +120,26 @@ jobs: path: | build/install/* + - name: 🗝️ Generate Steam TOTP + if: github.event_name == 'push' && github.repository == 'WerWolv/ImHex' && github.ref == 'refs/heads/master' + uses: CyberAndrii/steam-totp@v1 + id: steam-totp + with: + shared_secret: ${{ secrets.STEAM_SHARED_SECRET }} + + - name: 💨 Publish Steam Nightly + if: github.event_name == 'push' && github.repository == 'WerWolv/ImHex' && github.ref == 'refs/heads/master' + uses: WerWolv/steam-deploy@main + with: + username: ${{ secrets.STEAM_USERNAME }} + password: ${{ secrets.STEAM_PASSWORD }} + totp: ${{ steps.steam-totp.outputs.code }} + appId: 2186040 + buildDescription: v${{ env.IMHEX_VERSION }} - ${{ github.sha }} + rootPath: build + depot1Path: install + releaseBranch: nightly + # MacOS build macos: runs-on: macos-11 @@ -214,11 +234,13 @@ jobs: -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_OBJC_COMPILER_LAUNCHER=ccache \ -DCMAKE_OBJCXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_INSTALL_PREFIX="$PWD/install" \ -DIMHEX_PATTERNS_PULL_MASTER=ON \ -DCMAKE_OSX_DEPLOYMENT_TARGET="10.10" \ -DCPACK_PACKAGE_FILE_NAME="imhex-${{env.IMHEX_VERSION}}-macOS${{matrix.suffix}}" \ .. make -j4 package + make -j4 install - name: ⬆️ Upload DMG uses: actions/upload-artifact@v3 @@ -226,6 +248,26 @@ jobs: name: macOS DMG${{matrix.suffix}} path: build/*.dmg + - name: 🗝️ Generate Steam TOTP + if: github.event_name == 'push' && github.repository == 'WerWolv/ImHex' && github.ref == 'refs/heads/master' && !matrix.custom_glfw + uses: CyberAndrii/steam-totp@v1 + id: steam-totp + with: + shared_secret: ${{ secrets.STEAM_SHARED_SECRET }} + + - name: 💨 Publish Steam Nightly + if: github.event_name == 'push' && github.repository == 'WerWolv/ImHex' && github.ref == 'refs/heads/master' && !matrix.custom_glfw + uses: WerWolv/steam-deploy@main + with: + username: ${{ secrets.STEAM_USERNAME }} + password: ${{ secrets.STEAM_PASSWORD }} + totp: ${{ steps.steam-totp.outputs.code }} + appId: 2186040 + buildDescription: v${{ env.IMHEX_VERSION }} - ${{ github.sha }} + rootPath: build + depot2Path: install + releaseBranch: nightly + # Ubuntu build ubuntu: runs-on: ubuntu-22.04 @@ -327,6 +369,8 @@ jobs: export VERSION=${{env.IMHEX_VERSION}} appimage-builder --recipe ../dist/AppImageBuilder.yml cd .. + mkdir AppImage + find . -name "*.AppImage" -exec cp '{}' AppImage/ \; #- name: ⬆️ Upload Flatpak # uses: actions/upload-artifact@v3 @@ -353,6 +397,26 @@ jobs: name: Linux AppImage zsync path: 'build-appimage/*.AppImage.zsync' + - name: 🗝️ Generate Steam TOTP + if: github.event_name == 'push' && github.repository == 'WerWolv/ImHex' && github.ref == 'refs/heads/master' + uses: CyberAndrii/steam-totp@v1 + id: steam-totp + with: + shared_secret: ${{ secrets.STEAM_SHARED_SECRET }} + + - name: 💨 Publish Steam Nightly + if: github.event_name == 'push' && github.repository == 'WerWolv/ImHex' && github.ref == 'refs/heads/master' + uses: WerWolv/steam-deploy@main + with: + username: ${{ secrets.STEAM_USERNAME }} + password: ${{ secrets.STEAM_PASSWORD }} + totp: ${{ steps.steam-totp.outputs.code }} + appId: 2186040 + buildDescription: v${{ env.IMHEX_VERSION }} - ${{ github.sha }} + rootPath: AppImage + depot3Path: . + releaseBranch: nightly + # ArchLinux build archlinux-build: name: 🐧 ArchLinux