diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index d74b83ba..63d988b5 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -5,81 +5,62 @@ on: push: branches: [ master ] tags-ignore: - - 'v*' # Don't run if tagged as v*. + - 'v*' pull_request: branches: [ master ] +# Added top-level permissions block for GitHub Actions cache access +permissions: + contents: read + actions: write + jobs: build-windows: - runs-on: windows-latest steps: - - uses: actions/checkout@v4 - - name: run-vcpkg - uses: lukka/run-vcpkg@v11 + # 1. Checkout your forked YSCE repository + - name: Checkout YSCE + uses: actions/checkout@v4 with: - vcpkgJsonGlob: ../src/vcpkg.json, - vcpkgGitCommitId: 5b1214315250939257ef5d62ecdcbca18cf4fb1c - - name: Install dependencies - run: vcpkg install --triplet x64-windows - working-directory: src - - name: checkout_public - run: git clone https://github.com/YSCEDC/ysce_public.git - - name: mkdir - run: mkdir ci_windows - - name: cmake - run: cmake ../src -DCMAKE_PREFIX_PATH=D:/a/YSCE/YSCE/vcpkg/installed/x64-windows -DCMAKE_TOOLCHAIN_FILE=D:/a/YSCE/YSCE/vcpkg/scripts/buildsystems/vcpkg.cmake - working-directory: ./ci_windows - - name: build - run: cmake --build . --config Release --parallel --target ysflight64_gl1 ysflight64_gl2 ysflight64_gl1demo ysflight64_gl2demo ysflight64_nownd - # Cannot build ysflight64_d3d9 in github workflow because the virtual machine does not have DirectX9 libraries. - working-directory: ./ci_windows - - uses: actions/upload-artifact@v4 + submodules: recursive + + # 2. Checkout the public library into the expected directory structure + - name: Checkout Public Repository + uses: actions/checkout@v4 with: - name: ys-build-windows - path: ./ci_windows/main/Release - retention-days: 14 - + repository: 'YSCEDC/ysce_public' + path: 'ysce_public' - build-linux: + # 3. Setup and run vcpkg + - name: Run vcpkg + uses: lukka/run-vcpkg@v11 + with: + vcpkgJsonGlob: '**/src/vcpkg.json' + vcpkgGitCommitId: c0948694cceff995e5cf90b751e0c5a95d613458 + env: + ACTIONS_RUNTIME_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ACTIONS_CACHE_URL: ${{ github.api_url }}/_apis/artifactcache/ - runs-on: ubuntu-latest + # 4. Configure CMake + - name: Configure CMake + run: | + cmake -B ci_windows -S src ` + -DCMAKE_BUILD_TYPE=Release ` + -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" + env: + ACTIONS_RUNTIME_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ACTIONS_CACHE_URL: ${{ github.api_url }}/_apis/artifactcache/ - steps: - - uses: actions/checkout@v4 + # 5. Compile selected targets + - name: Build Targets + run: | + cmake --build ci_windows --config Release --parallel --target ysflight64_gl1 ysflight64_gl2 ysflight64_gl1demo ysflight64_gl2demo ysflight64_nownd - - name: Install vcpkg - uses: lukka/run-vcpkg@v11 + # 6. Upload Artifacts + - name: Upload Artifacts + uses: actions/upload-artifact@v4 with: - vcpkgArguments: --triplet x64-linux - vcpkgGitCommitId: 5b1214315250939257ef5d62ecdcbca18cf4fb1c - - name: Install dependencies - run: vcpkg install --triplet x64-linux - working-directory: src - - name: checkout_public - run: git clone https://github.com/YSCEDC/ysce_public.git - - name: mkdir - run: mkdir ci_ubuntu - - name: apt-get-update - run: sudo apt-get update - - name: install-OpenGL - run: sudo apt-get install libglu1-mesa-dev mesa-common-dev - - name: install-ALSA - run: sudo apt-get install libasound2t64 libasound2-dev - - name: install-PulseAudio - run: sudo apt-get install pulseaudio libpulse-dev - - name: install-Python - run: sudo apt-get install python3 python-is-python3 - - name: cmake - run: cmake ../src -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/home/runner/work/YSCE/YSCE/vcpkg/installed/x64-linux -DCMAKE_TOOLCHAIN_FILE=/home/runner/work/YSCE/YSCE/vcpkg/scripts/buildsystems/vcpkg.cmake - working-directory: ./ci_ubuntu - - name: build - run: cmake --build . --config Release --parallel --target ysflight64_gl1 ysflight64_gl2 ysflight64_gl1demo ysflight64_gl2demo ysflight64_nownd - working-directory: ./ci_ubuntu - - uses: actions/upload-artifact@v4 - with: - name: ys-build-linux - path: ./ci_ubuntu/main/ + name: ys-build-windows + path: ./ci_windows/main/Release retention-days: 14 -# MacOS was here, but Nodoka kicked it off a short pier. diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..c7ebc715 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,34 @@ +name: Build YSCE Project + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout Public Repository + uses: actions/checkout@v4 + with: + repository: 'YSCEDC/ysce_public' + path: 'ysce_public' + + - name: Checkout Forked Repository + uses: actions/checkout@v4 + with: + path: 'YSCE' + + - name: Configure CMake + run: | + cd YSCE + cmake -B build -S src + + - name: Build Project + run: | + cd YSCE + cmake --build build --config Release --parallel $(nproc) diff --git a/readme.md b/readme.md index 332cd626..06348ea0 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ # YSFlight Community Edition (YSCE) -This repository is home to the YSFlight Community Edition fork of YSFlight. If you are interested in joining the project, please email Current Repository maintainer Nodoka Hanamura at nodo-at-kahanamura.com (temporary) or contact any of the current YSCEDC contributors on YSFlight Headquarters (https://www.ysfhq.com/). +This repository is home to the YSFlight Community Edition fork of YSFlight. Here I have added compiled downloads to help those who couldn't compile it! # DISCLAIMER @@ -28,7 +28,7 @@ Current YSCEDC Contributors (Code, Design, Advisory): * pasutisu (Mofumofu) * JOBBIN -To compile YSCE at this time, please follow the instructions below. +If you prefer compiling YSCE yourself (the downloads are much easier), here are the steps: ## Compile Instruction Prequisites are: @@ -36,7 +36,7 @@ Prequisites are: * Any CMake-compatible compiler * The YSCE Public Libraries (Fork of YSFLIGHT Public Libraries) -Open your preferred terminal client and input the following commands in your build area: +Open your preferred terminal client and input the following commands in your build area (This is for Linux only): ``` git clone https://github.com/YSCEDC/ysce_public.git