Build project #69
Workflow file for this run
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 project | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| buildForAllSupportedPlatforms: | |
| name: Build for ${{ matrix.targetPlatform }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| targetPlatform: | |
| - StandaloneOSX | |
| - StandaloneWindows64 | |
| - StandaloneLinux64 | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| - name: Enable caching | |
| uses: actions/cache@v4.2.0 | |
| with: | |
| path: Library | |
| key: Library-${{ matrix.targetPlatform }} | |
| restore-keys: Library- | |
| - name: Build project | |
| uses: game-ci/unity-builder@v4 | |
| env: | |
| UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
| UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
| UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
| with: | |
| targetPlatform: ${{ matrix.targetPlatform }} | |
| buildName: Husky Robotics Simulator | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4.6.2 | |
| with: | |
| name: ${{ matrix.targetPlatform }} | |
| path: build/${{ matrix.targetPlatform }} | |
| publishRelease: | |
| name: Publish release | |
| runs-on: ubuntu-latest | |
| needs: buildForAllSupportedPlatforms | |
| steps: | |
| - name: Create new release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Husky Robotics Simulator ${{ github.ref }} | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4.2.1 | |
| - name: Zip build files | |
| run: | | |
| cd StandaloneOSX | |
| zip -r ../StandaloneOSX.zip ./* | |
| cd .. | |
| cd StandaloneWindows64 | |
| zip -r ../StandaloneWindows64.zip ./* | |
| cd .. | |
| cd StandaloneLinux64 | |
| zip -r ../StandaloneLinux64.zip ./* | |
| cd .. | |
| - name: Upload macOS build to release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./StandaloneOSX.zip | |
| asset_name: StandaloneOSX.zip | |
| asset_content_type: application/zip | |
| - name: Upload Windows build to release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./StandaloneWindows64.zip | |
| asset_name: StandaloneWindows64.zip | |
| asset_content_type: application/zip | |
| - name: Upload Linux build to release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./StandaloneLinux64.zip | |
| asset_name: StandaloneLinux64.zip | |
| asset_content_type: application/zip |