Run Windows manager under Service Control Manager #1554
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: Build and Upload | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04 | |
| target: x86_64-unknown-linux-musl | |
| dir: musl | |
| - os: ubuntu-24.04 | |
| target: aarch64-unknown-linux-musl | |
| dir: musl-arm64 | |
| # - os: ubuntu-24.04 | |
| # target: x86_64-unknown-linux-gnu | |
| # dir: gnu | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # ---------- Rust / Cargo caches ---------- | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/registry | |
| key: ${{ runner.os }}-cargo-registry--${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-registry-- | |
| - name: Cache cargo index | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-git--${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-git-- | |
| - name: Cache cargo binaries | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/binaries | |
| key: ${{ runner.os }}-cargo-bin--${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-bin-- | |
| - name: Cache target directory | |
| uses: actions/cache@v4 | |
| with: | |
| path: target | |
| key: ${{ runner.os }}-target-${{ matrix.target }}--${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-target-${{ matrix.target }}-- | |
| # ---------- End caches ---------- | |
| - name: Install musl-tools (Linux) | |
| if: ${{ matrix.dir == 'musl' }} | |
| run: sudo apt-get install -y musl-tools | |
| - name: Install Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| profile: minimal | |
| toolchain: stable | |
| override: true | |
| target: ${{ matrix.target }} | |
| - name: Install cross (only for arm64) | |
| if: ${{ matrix.target == 'aarch64-unknown-linux-musl' }} | |
| run: cargo install cross --locked | |
| - name: Build client | |
| run: | | |
| if [ "${{ matrix.target }}" = "aarch64-unknown-linux-musl" ]; then | |
| cross build --locked --release --target "${{ matrix.target }}" --manifest-path binaries/geph5-client/Cargo.toml | |
| else | |
| cargo build --locked --release --target "${{ matrix.target }}" --features aws_lambda --manifest-path binaries/geph5-client/Cargo.toml | |
| fi | |
| - name: Move client binaries to artifacts directory | |
| shell: bash | |
| run: | | |
| mkdir -p artifacts/${{ matrix.dir }} | |
| mv target/${{ matrix.target }}/release/geph5-client artifacts/${{ matrix.dir }}/ | |
| - name: Install cargo-bundle | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| if [ ! -f ~/.cargo/bin/cargo-bundle ]; then | |
| cargo install cargo-bundle --locked --version "=0.6.0" --force | |
| fi | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.dir }}-latest | |
| path: artifacts/${{ matrix.dir }} | |
| build-bridge-exit: | |
| name: Build Bridge, Exit, and Broker (Musl) | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # ---------- Rust / Cargo caches ---------- | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/registry | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-registry- | |
| - name: Cache cargo index | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-git- | |
| - name: Cache target directory | |
| uses: actions/cache@v4 | |
| with: | |
| path: target | |
| key: ${{ runner.os }}-BEB-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-BEB- | |
| # ---------- End caches ---------- | |
| - name: Install musl-tools | |
| run: sudo apt-get install -y musl-tools | |
| - name: Install Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| profile: minimal | |
| toolchain: stable | |
| override: true | |
| target: x86_64-unknown-linux-musl | |
| - name: Set default host | |
| shell: bash | |
| run: rustup set default-host x86_64-unknown-linux-musl | |
| - name: Build bridge and exit and broker | |
| run: | | |
| cargo build --locked --release --target x86_64-unknown-linux-musl --manifest-path binaries/geph5-bridge/Cargo.toml | |
| cargo build --locked --release --target x86_64-unknown-linux-musl --manifest-path binaries/geph5-exit/Cargo.toml | |
| cargo build --locked --release --target x86_64-unknown-linux-musl --manifest-path binaries/geph5-broker/Cargo.toml | |
| - name: Move bridge and exit binaries to artifacts directory | |
| run: | | |
| mkdir -p artifacts/musl | |
| mv target/x86_64-unknown-linux-musl/release/geph5-bridge artifacts/musl/ | |
| mv target/x86_64-unknown-linux-musl/release/geph5-broker artifacts/musl/ | |
| mv target/x86_64-unknown-linux-musl/release/geph5-exit artifacts/musl/ | |
| - name: Upload bridge and exit artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: musl-latest-bridge | |
| path: artifacts/musl | |
| upload: | |
| if: github.ref == 'refs/heads/master' | |
| needs: [build, build-bridge-exit] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Move some stuff | |
| run: | | |
| mv artifacts/musl-latest-bridge/* artifacts/musl-latest/ | |
| rmdir artifacts/musl-latest-bridge | |
| - name: Install rclone | |
| run: | | |
| curl https://rclone.org/install.sh | sudo bash | |
| - name: Configure rclone | |
| run: | | |
| mkdir -p ~/.config/rclone | |
| cat > ~/.config/rclone/rclone.conf << EOF | |
| [r2] | |
| type = s3 | |
| provider = Cloudflare | |
| access_key_id = ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| secret_access_key = ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| region = auto | |
| endpoint = https://b5e397a549f0e6543dba8e1d83ca9924.r2.cloudflarestorage.com | |
| acl = private | |
| EOF | |
| - name: Upload to Cloudflare R2 | |
| run: | | |
| rclone copy -P ./artifacts/ r2:geph5/ --multi-thread-streams 8 --multi-thread-cutoff 1M --timeout 10s |