From c84543b0625b20856a4d5724ce3890ff651e5b75 Mon Sep 17 00:00:00 2001 From: E99p1ant Date: Wed, 15 Jul 2020 22:32:29 +0800 Subject: [PATCH] feat: ci --- .github/workflows/build.yml | 58 +++++++++++++++++++++++++++ ProjectSettings/ProjectSettings.asset | 2 +- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..bac9eb6 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,58 @@ +name: Build project + +on: + release: + types: [published] + +env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + +jobs: + buildForSomePlatforms: + name: Build for ${{ matrix.targetPlatform }} on version ${{ matrix.unityVersion }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + buildName: + - Asteroid + projectPath: + - ./ + unityVersion: + - 2019.1.0f2 + targetPlatform: + - StandaloneOSX # Build a macOS standalone (Intel 64-bit). + - StandaloneWindows # Build a Windows standalone. + - StandaloneWindows64 # Build a Windows 64-bit standalone. + - StandaloneLinux64 # Build a Linux 64-bit standalone. + + steps: + - uses: actions/checkout@v2 + with: + lfs: true + + - uses: webbertakken/unity-builder@v1.1 + with: + buildName: ${{ matrix.buildName }} + projectPath: ${{ matrix.projectPath }} + unityVersion: ${{ matrix.unityVersion }} + targetPlatform: ${{ matrix.targetPlatform }} + + - uses: actions/upload-artifact@v1 + with: + name: Build + path: build + + - name: Zip Binary + run: zip -r Asteroid_${{ matrix.targetPlatform }}.zip build/${{ matrix.targetPlatform }}/* + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./Asteroid_${{ matrix.targetPlatform }}.zip + asset_name: Asteroid_${{ matrix.targetPlatform }}.zip + asset_content_type: application/zip \ No newline at end of file diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 75f0a58..41f7e04 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -13,7 +13,7 @@ PlayerSettings: useOnDemandResources: 0 accelerometerFrequency: 60 companyName: Vidar-Team - productName: D3CTF biubiubiu + productName: Asteroid defaultCursor: {fileID: 0} cursorHotspot: {x: 0, y: 0} m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}