Workflow: recreate latest tag #10
This file contains 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: PS Vita server and Windows MSYS2 client builds | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
paths-ignore: | |
- '**/*.md' | |
- 'docs/**' | |
- 'README.md' | |
- 'gyro_accel_tester' | |
pull_request: | |
branches: | |
- main | |
- dev | |
paths-ignore: | |
- '**/*.md' | |
- 'docs/**' | |
- 'README.md' | |
- 'gyro_accel_tester' | |
jobs: | |
create_dev_release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create Development release | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "latest" | |
prerelease: true | |
title: "Development Build" | |
build_vita_server: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install flatc | |
run: | | |
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: | | |
echo "VITASDK=/usr/local/vitasdk" >> $GITHUB_ENV | |
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: Build VitaPad | |
run: | | |
cmake -S server -B build -D CMAKE_BUILD_TYPE=Release | |
cmake --build build | |
- 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-i686-gcc | |
mingw-w64-x86_64-rust | |
mingw-w64-i686-rust | |
mingw-w64-x86_64-flatbuffers | |
make | |
wget | |
cmake | |
- name: Cache Cargo registry and build | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- name: Install dependencies | |
run: | | |
pacman -S --noconfirm mingw-w64-x86_64-rust mingw-w64-i686-rust mingw-w64-x86_64-flatbuffers mingw-w64-x86_64-cargo-c mingw-w64-i686-cargo-c make wget cmake | |
wget https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-flatbuffers-23.5.26-2-any.pkg.tar.zst | |
pacman -U --noconfirm mingw-w64-i686-flatbuffers-23.5.26-2-any.pkg.tar.zst | |
- name: Build Windows x64 Client | |
run: | | |
export PATH="${{ steps.msys2.outputs.msys2-location }}/mingw64/bin:${PATH}" | |
cd ./client | |
cargo build --release --bin cli | |
cp ./target/release/cli.exe ./target/release/VitaPad-x64.exe | |
- name: Upload Windows x64 binary as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: VitaPad-x64.exe | |
path: ./client/target/release/VitaPad-x64.exe | |
- name: Build Windows x32 Client | |
run: | | |
export PATH="${{ steps.msys2.outputs.msys2-location }}/mingw32/bin:${PATH}" | |
cd ./client | |
CARGO_TARGET_ARCH="i686" cargo build --release --bin cli | |
cp ./target/release/cli.exe ./target/release/VitaPad-x32.exe | |
- name: Upload Windows x32 binary as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: VitaPad-x32.exe | |
path: ./client/target/release/VitaPad-x32.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 VitaPad-x64.exe artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: VitaPad-x64.exe | |
path: ./release | |
- name: Download VitaPad-x32.exe artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: VitaPad-x32.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/VitaPad-x64.exe | |
./release/VitaPad-x32.exe | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |