From 7cb637c71ff7c83df45849cc2b1dcad12f2363ef Mon Sep 17 00:00:00 2001 From: DvaMishkiLapa Date: Tue, 15 Oct 2024 11:14:51 +0200 Subject: [PATCH] Workflows: fixed development release workflow --- .github/workflows/release.yml | 159 +++++++++++++++++----------------- 1 file changed, 79 insertions(+), 80 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f59649e..ce0ba8d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,84 +1,31 @@ -name: Create release +name: PS Vita server and Windows MSYS2 client builds on: push: - tags: - - "[0-9]+.[0-9]+.[0-9]+" + branches: + - main + - dev + pull_request: + branches: + - main + - dev jobs: - create-release: + build_vita_server: runs-on: ubuntu-latest - outputs: - release_id: ${{ steps.release.outputs.id }} - upload_url: ${{ steps.release.outputs.upload_url }} steps: - - uses: actions/checkout@v2 - - name: Release - id: release - uses: softprops/action-gh-release@v1 - - client: - permissions: - contents: write - strategy: - fail-fast: false - matrix: - platform: [ubuntu-latest, windows-latest] - - runs-on: ${{ matrix.platform }} - needs: create-release - steps: - - uses: actions/checkout@v3 - - - name: setup node - uses: actions/setup-node@v3 - with: - node-version: 18 - - - name: install Rust stable - uses: dtolnay/rust-toolchain@stable - - - name: install dependencies (ubuntu only) - if: matrix.platform == 'ubuntu-latest' - run: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf make git-core cmake python3 - - - uses: actions/checkout@v3 - with: - repository: google/flatbuffers - path: flatbuffers - - - name: Install flatc - run: | - cmake -B build -S flatbuffers - cmake --install build - - - name: install frontend dependencies - run: cd client/packages/gui && pnpm install - - - uses: tauri-apps/tauri-action@v0 - with: - projectPath: client/packages/gui - releaseId: ${{ needs.create-release.outputs.release_id }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - server: - runs-on: ubuntu-latest - needs: create-release - steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install flatc run: | - sudo apt-get update - sudo apt-get install -y make git-core cmake python3 + sudo apt update + sudo apt install -y make git-core cmake python3 git clone https://github.com/google/flatbuffers.git cd flatbuffers cmake -G "Unix Makefiles" make -j sudo make install + sudo ldconfig - name: Install VitaSDK run: | @@ -86,24 +33,76 @@ jobs: git clone https://github.com/vitasdk/vdpm cd vdpm export VITASDK=/usr/local/vitasdk + export PATH="$VITASDK/bin:$PATH" ./bootstrap-vitasdk.sh ./install-all.sh + ./vdpm flatbuffers - - name: Install flatbuffers - run: | - sudo apt-get install -y libarchive-tools xutils-dev - git clone https://github.com/musikid/packages - cd packages/flatbuffers - export PATH="$VITASDK/bin:$PATH" - vita-makepkg -C -f -d -i - - - name: Build + - name: Build VitaPad run: | cmake -S server -B build -D CMAKE_BUILD_TYPE=Release cmake --build build - - - name: Upload release asset - uses: softprops/action-gh-release@v1 + + - name: Upload VPK as artifact + uses: actions/upload-artifact@v4 + with: + name: VitaPad.vpk + path: build/VitaPad.vpk + + build_windows_client: + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + steps: + - uses: actions/checkout@v4 + - uses: msys2/setup-msys2@v2 + with: + msystem: UCRT64 + update: true + install: git mingw-w64-ucrt-x86_64-gcc mingw-w64-x86_64-rust mingw-w64-x86_64-flatbuffers make wget cmake + + - name: Install dependencies + run: | + pacman -S --noconfirm mingw-w64-x86_64-rust mingw-w64-x86_64-flatbuffers mingw-w64-x86_64-cargo-c make wget cmake + + - name: Build Windows Client + run: | + export PATH="${{ steps.msys2.outputs.msys2-location }}/mingw64/bin:${PATH}" + cd ./client + cargo build --release --bin cli + + - name: Upload CLI Binary as artifact + uses: actions/upload-artifact@v4 with: - files: build/VitaPad.vpk - + name: cli.exe + path: ./client/target/release/cli.exe + + create_release: + needs: [build_vita_server, build_windows_client] + runs-on: ubuntu-latest + steps: + - name: Download VitaPad.vpk artifact + uses: actions/download-artifact@v4 + with: + name: VitaPad.vpk + path: ./release + + - name: Download cli.exe artifact + uses: actions/download-artifact@v4 + with: + name: cli.exe + path: ./release + + - name: Upload development release + if: ${{ github.event_name != 'pull_request' }} + uses: softprops/action-gh-release@v2 + with: + name: Development Build + tag_name: "latest" + prerelease: true + files: | + ./release/VitaPad.vpk + ./release/cli.exe + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}