Release #57
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
| name: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Release tag (e.g. v1.0.0)" | |
| required: true | |
| jobs: | |
| # 1. Build client and upload artifact | |
| client: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: | | |
| client/package-lock.json | |
| client/package.json | |
| - name: Install NPM Dependencies | |
| working-directory: client | |
| run: npm install | |
| - name: Setup Aftman | |
| uses: ok-nick/setup-aftman@v0.4.2 | |
| with: | |
| path: client | |
| cache: true | |
| - name: Install Lune | |
| working-directory: client | |
| run: aftman install | |
| - name: Build Client | |
| working-directory: client | |
| run: npm run bundle-ci | |
| - name: Upload Client Artifact | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: client | |
| path: client/dist/main.lua | |
| # 2. Build server (macOS) and upload artifact | |
| server-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| target: aarch64-apple-darwin | |
| - name: Cache Cargo registry + build | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| cargo-${{ runner.os }}- | |
| - name: Build Server (macOS) | |
| working-directory: server | |
| run: cargo build --release | |
| - name: Copy Binary | |
| run: | | |
| cp server/target/release/roblox-chess-script ./roblox-chess-script-aarch64-apple | |
| - name: Upload macOS Server Artifact | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: server-macos | |
| path: roblox-chess-script-aarch64-apple | |
| # 3. Build server (Windows) and upload artifact | |
| server-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| target: x86_64-pc-windows-msvc | |
| - name: Cache Cargo registry + build | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| cargo-${{ runner.os }}- | |
| - name: Build Server (Windows) | |
| working-directory: server | |
| run: cargo build --release | |
| - name: Copy Binary | |
| run: | | |
| cp server/target/release/roblox-chess-script.exe roblox-chess-script-windows-x64.exe | |
| - name: Upload Windows Server Artifact | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: server-windows | |
| path: roblox-chess-script-windows-x64.exe | |
| # 4. Create release after all builds | |
| create-release: | |
| needs: [client, server-macos, server-windows] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download Client Artifact | |
| uses: actions/download-artifact@v3 | |
| with: | |
| name: client | |
| path: artifacts/ | |
| - name: Download macOS Server Artifact | |
| uses: actions/download-artifact@v3 | |
| with: | |
| name: server-macos | |
| path: artifacts/ | |
| - name: Download Windows Server Artifact | |
| uses: actions/download-artifact@v3 | |
| with: | |
| name: server-windows | |
| path: artifacts/ | |
| - name: Create GitHub Release & Upload Assets | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.event.inputs.tag }} | |
| files: | | |
| artifacts/client/dist/main.lua | |
| artifacts/roblox-chess-script-aarch64-apple | |
| artifacts/roblox-chess-script-windows-x64.exe | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # name: Release | |
| # on: | |
| # workflow_dispatch: | |
| # inputs: | |
| # tag: | |
| # description: "Release tag (e.g. v1.0.0)" | |
| # required: true | |
| # jobs: | |
| # create-release: | |
| # needs: [client, server-macos, server-windows] | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - uses: softprops/action-gh-release@v1 | |
| # with: | |
| # tag_name: ${{ github.event.inputs.tag }} | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # client: | |
| # runs-on: macos-latest | |
| # steps: | |
| # - uses: actions/checkout@v3 | |
| # - name: Setup Node | |
| # uses: actions/setup-node@v4 | |
| # with: | |
| # node-version: "20" | |
| # cache: "npm" | |
| # cache-dependency-path: | | |
| # client/package-lock.json | |
| # client/package.json | |
| # token: ${{ github.token}} | |
| # - name: Install NPM Dependencies | |
| # working-directory: client | |
| # run: npm install | |
| # - name: Setup Aftman | |
| # uses: ok-nick/setup-aftman@v0.4.2 | |
| # with: | |
| # path: client | |
| # cache: true | |
| # token: ${{ github.token }} | |
| # - name: Install Lune | |
| # working-directory: client | |
| # run: | | |
| # aftman install | |
| # - name: Build Client | |
| # working-directory: client | |
| # run: | | |
| # npm run bundle-ci | |
| # - name: Upload Client Artifact | |
| # uses: softprops/action-gh-release@v1 | |
| # with: | |
| # tag_name: ${{ github.event.inputs.tag }} | |
| # files: client/dist/main.lua | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # server-macos: | |
| # runs-on: macos-latest | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # - name: Set up Rust toolchain | |
| # uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| # with: | |
| # toolchain: stable | |
| # target: aarch64-apple-darwin | |
| # - name: Cache Cargo registry + build | |
| # uses: actions/cache@v3 | |
| # with: | |
| # path: | | |
| # ~/.cargo/registry | |
| # ~/.cargo/git | |
| # target | |
| # key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} | |
| # restore-keys: | | |
| # cargo-${{ runner.os }}- | |
| # - name: Build Server (macOS) | |
| # working-directory: server | |
| # run: cargo build --release | |
| # - run: cp ./server/target/release/roblox-chess-script ./roblox-chess-script-aarch64-apple | |
| # - name: Upload Client Artifact | |
| # uses: softprops/action-gh-release@v1 | |
| # with: | |
| # tag_name: ${{ github.event.inputs.tag }} | |
| # files: ./roblox-chess-script-aarch64-apple | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # server-windows: | |
| # runs-on: windows-latest | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # - name: Set up Rust toolchain | |
| # uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| # with: | |
| # toolchain: stable | |
| # target: x86_64-pc-windows-msvc | |
| # - name: Cache Cargo registry + build | |
| # uses: actions/cache@v3 | |
| # with: | |
| # path: | | |
| # ~/.cargo/registry | |
| # ~/.cargo/git | |
| # target | |
| # key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} | |
| # restore-keys: | | |
| # cargo-${{ runner.os }}- | |
| # - name: Build Server (Windows) | |
| # working-directory: server | |
| # run: cargo build --release | |
| # - run: cp ./server/target/release/roblox-chess-script.exe ./roblox-chess-script-windows-x64.exe | |
| # - name: Upload Client Artifact | |
| # uses: softprops/action-gh-release@v1 | |
| # with: | |
| # tag_name: ${{ github.event.inputs.tag }} | |
| # files: ./roblox-chess-script-windows-x64.exe | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |