diff --git a/.github/workflows/ci_release.yml b/.github/workflows/archive_steamos.yml similarity index 85% rename from .github/workflows/ci_release.yml rename to .github/workflows/archive_steamos.yml index d60e474..fbbeb56 100644 --- a/.github/workflows/ci_release.yml +++ b/.github/workflows/archive_steamos.yml @@ -1,12 +1,10 @@ -name: ci_release +name: archive_release_steamos on: - workflow_dispatch: # Enables manual triggers - push: - branches: ["master"] + workflow_dispatch: # Enables manual triggers jobs: - release: + steamos: runs-on: [self-hosted, linux] steps: - uses: actions/checkout@v4 @@ -26,7 +24,7 @@ jobs: - name: Build run: | cargo build --release --locked --target=x86_64-unknown-linux-gnu - + - name: Archive run: | cp target/x86_64-unknown-linux-gnu/release/hedz_reloaded hedz_reloaded @@ -35,4 +33,4 @@ jobs: - uses: actions/upload-artifact@v4 with: name: steamos.tar.gz - path: ./steamos.tar.gz \ No newline at end of file + path: ./steamos.tar.gz diff --git a/.github/workflows/archive_win.yml b/.github/workflows/archive_win.yml new file mode 100644 index 0000000..07188d8 --- /dev/null +++ b/.github/workflows/archive_win.yml @@ -0,0 +1,42 @@ +name: archive_win + +on: + workflow_dispatch: # Enables manual triggers + +jobs: + win: + runs-on: [self-hosted, linux] + steps: + - uses: actions/checkout@v4 + - uses: cargo-bins/cargo-binstall@main + - uses: extractions/setup-just@v1 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: llvm-tools-preview + targets: x86_64-pc-windows-msvc + + - name: Configure Cargo (Windows) + run: | + which cargo-xwin || cargo install --locked cargo-xwin + + - name: "Install and cache dependencies (Windows)" + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: lld clang cmake ninja-build + version: 1.0 + + - name: Build binaries (Windows) + run: | + cargo xwin build --locked --release --target=x86_64-pc-windows-msvc + + - name: Archive + run: | + ls -lisa target/x86_64-pc-windows-msvc/release/ + cp target/x86_64-pc-windows-msvc/release/hedz_reloaded.exe hedz_reloaded.exe + tar -czf win.tar.gz hedz_reloaded.exe + + - uses: actions/upload-artifact@v4 + with: + name: win.tar.gz + path: ./win.tar.gz diff --git a/.github/workflows/steam_alpha.yml b/.github/workflows/steam_alpha.yml index d929c72..523a373 100644 --- a/.github/workflows/steam_alpha.yml +++ b/.github/workflows/steam_alpha.yml @@ -168,3 +168,59 @@ jobs: with: webhook_url: ${{ secrets.DISCORD_WEBHOOK }} message: New steamos release (`${{ steps.vars.outputs.branch }}`) [`${{ steps.vars.outputs.sha_short }}`] + + steam-windows: + runs-on: [self-hosted, linux] + steps: + - uses: actions/checkout@v4 + - uses: cargo-bins/cargo-binstall@main + - uses: extractions/setup-just@v1 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: llvm-tools-preview + targets: x86_64-pc-windows-msvc + + - name: Configure Cargo (Windows) + run: | + which cargo-xwin || cargo install --locked cargo-xwin + + - name: "Install and cache dependencies (Windows)" + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: lld clang cmake ninja-build + version: 1.0 + + - name: Build binaries (Windows) + run: | + cargo xwin build --locked --release --target=x86_64-pc-windows-msvc + + - name: Move binary + run: | + ls -lisa target/x86_64-pc-windows-msvc/release/ + cp target/x86_64-pc-windows-msvc/release/hedz_reloaded.exe build/win/hedz_reloaded.exe + + - uses: ./.github/actions/steamcmd + with: + config: ${{ secrets.STEAM_CONFIG_VDF_BASE64 }} + + - name: Steam deploy + env: + # needs to be fully qualified path for steamcmd to find it + DEPOT: ${{ github.workspace }}/build/steamos/scripts/hz_win.vdf + STEAM_USR: ${{ secrets.STEAM_USR }} + run: | + cd build/steamos + ~/Steam/steamcmd.sh +login $STEAM_USR +run_app_build $DEPOT +quit + + - name: Set outputs + id: vars + run: | + echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + + - name: Discord notification + uses: appleboy/discord-action@v1.2.0 + with: + webhook_url: ${{ secrets.DISCORD_WEBHOOK }} + message: New windows release (`${{ steps.vars.outputs.branch }}`) [`${{ steps.vars.outputs.sha_short }}`] diff --git a/build/steamos/justfile b/build/steamos/justfile index e8c2f46..b2ffbb0 100644 --- a/build/steamos/justfile +++ b/build/steamos/justfile @@ -21,3 +21,6 @@ build: steam_macos: cd ../macos && just build-app ./builder_osx/steamcmd +login $STEAM_USR +run_app_build ../scripts/hz_macos.vdf +quit + +steam_win: + ./builder_osx/steamcmd +login $STEAM_USR +run_app_build ../scripts/hz_win.vdf +quit diff --git a/build/steamos/scripts/hz_win.vdf b/build/steamos/scripts/hz_win.vdf new file mode 100644 index 0000000..004e31e --- /dev/null +++ b/build/steamos/scripts/hz_win.vdf @@ -0,0 +1,30 @@ +"AppBuild" +{ + "AppID" "1603000" // your AppID + "Desc" "win build" + "verbose" "1" // spew more build details in console + + "SetLive" "alpha" + "ContentRoot" "../../" // root content folder, relative to location of this file + "BuildOutput" "../output" // build output folder for build logs and build cache files + + "Depots" + { + "1603003" + { + "FileMapping" + { + "LocalPath" "../assets/*" // all files from contentroot folder + "DepotPath" "./assets" // mapped into the root of the depot + "recursive" "1" // include all subfolders + } + + "FileMapping" + { + "LocalPath" "win/*" + "DepotPath" "." + "recursive" "1" + } + } + } +} diff --git a/build/win/steam_api64.dll b/build/win/steam_api64.dll new file mode 100644 index 0000000..ce20eea Binary files /dev/null and b/build/win/steam_api64.dll differ diff --git a/build/win/steam_api64.lib b/build/win/steam_api64.lib new file mode 100644 index 0000000..845cf57 Binary files /dev/null and b/build/win/steam_api64.lib differ