From 1519b0ea4a44919d2aead20420d6760c083530df Mon Sep 17 00:00:00 2001 From: AritaYuto Date: Sun, 21 Jan 2024 13:56:08 +0900 Subject: [PATCH] Update release.yml --- .github/workflows/release.yml | 256 ++++++++++++++++------------------ 1 file changed, 123 insertions(+), 133 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cd373a1..a52146f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,49 +10,7 @@ on: permissions: contents: read -jobs: - unity-build: - permissions: - contents: write - pull-requests: write - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Checkout submodules - run: git submodule update --init --recursive - - - name: Set up .NET Core - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 7.0.x - - - name: setup python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - name: Build flatbuffers - run: python ExternalTools/BuildScripts/build_flatbuffers_csharp.py - - - name: Setup unity - uses: game-ci/unity-builder@v4 - env: - UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} - UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} - UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} - with: - projectPath: Plugins/Unity/project - buildMethod: GenUnityPackage.Export - - - name: Upload Artifact Unity - uses: actions/upload-artifact@v3 - with: - name: Artifact-Unity-Plugin - path: Plugins/Unity/Artifact - +jobs: # upload-plugins-artifact: # permissions: # contents: write @@ -71,7 +29,20 @@ jobs: # - name: Checkout submodules # run: git submodule update --init --recursive - + + # - name: setup python + # uses: actions/setup-python@v4 + # with: + # python-version: '3.10' + + # - run: pip install SCons + + # - name: Set up .NET Core + # if: runner.os == 'Linux' + # uses: actions/setup-dotnet@v4 + # with: + # dotnet-version: 7.0.x + # - name: Install cmake on ubuntu-latest # if: runner.os == 'Linux' # run: | @@ -92,13 +63,6 @@ jobs: # - name: Add msbuild to PATH # if: runner.os == 'Windows' # uses: microsoft/setup-msbuild@v1.1 - - # - name: setup python - # uses: actions/setup-python@v4 - # with: - # python-version: '3.10' - - # - run: pip install SCons # - name: Build flatbuffers # run: python ExternalTools/BuildScripts/build_flatbuffers.py @@ -106,6 +70,23 @@ jobs: # - name: Build Godot # run: python ExternalTools/BuildScripts/build_godot.py + # - name: Build unity + # if: runner.os == 'Linux' + # uses: game-ci/unity-builder@v4 + # env: + # UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + # UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + # UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + # with: + # projectPath: Plugins/Unity/project + # buildMethod: GenUnityPackage.Export + + # - name: Upload Artifact Unity + # uses: actions/upload-artifact@v3 + # with: + # name: Artifact-Unity-Plugin + # path: Plugins/Unity/Artifact + # - name: Upload Artifact Godot # uses: actions/upload-artifact@v3 # with: @@ -118,95 +99,104 @@ jobs: # name: Artifact-UnrealEngine-Plugin # path: Plugins/UnrealEngine - # upload-app-artifact: - # permissions: - # contents: write - # pull-requests: write + upload-app-artifact: + permissions: + contents: write + pull-requests: write - # runs-on: windows-latest + runs-on: windows-latest - # steps: - # - name: Checkout repository - # uses: actions/checkout@v2 + steps: + - name: Checkout repository + uses: actions/checkout@v2 - # - name: Set up .NET Core - # uses: actions/setup-dotnet@v4 - # with: - # dotnet-version: 7.0.x + - name: Set up .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 7.0.x - # - name: Build C# application - # run: dotnet build Application/BocchiTracker.WPF.sln -c Release - - # - name: Upload Artifact Application - # uses: actions/upload-artifact@v3 - # with: - # name: Artifact-BocchiTracker - # path: Application/WPF/Artifact/Release/net7.0-windows - - # create_draft_release: - # permissions: - # contents: write - # pull-requests: write + - name: Build C# application + run: dotnet build Application/BocchiTracker.WPF.sln -c Release - # runs-on: windows-latest - - # steps: - # - name: Delete drafts - # uses: hugo19941994/delete-draft-releases@v1.0.0 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # - name: Create release draft - # uses: release-drafter/release-drafter@v5 - # id: create_draft - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload Artifact Application + uses: actions/upload-artifact@v3 + with: + name: Artifact-BocchiTracker + path: Application/WPF/Artifact/Release/net7.0-windows - # - name: Archive UnrealEngine plugin - # run: Compress-Archive -Path "Plugins/UnrealEngine" -DestinationPath "UnrealEngine.zip" + create_draft_release: + needs: [upload-app-artifact] + permissions: + contents: write + pull-requests: write - # - name: Archive Unity plugin - # run: Compress-Archive -Path "Plugins/Unity" -DestinationPath "Unity.zip" + runs-on: windows-latest - # - name: Archive Godot plugin - # run: Compress-Archive -Path "Plugins/Godot" -DestinationPath "Godot.zip" + steps: + - name: Download All Artifacts + uses: actions/download-artifact@v4 + with: + path: Artifacts + pattern: Artifact-* + + - run: ls -R my-artifact - # - name: Upload Application - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.create_draft.outputs.upload_url }} - # asset_path: ./BocchiTracker.zip - # asset_name: BocchiTracker.zip - # asset_content_type: application/zip + # - name: Delete drafts + # uses: hugo19941994/delete-draft-releases@v1.0.0 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Upload UnrealEngine plugin - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.create_draft.outputs.upload_url }} - # asset_path: ./UnrealEngine.zip - # asset_name: UnrealEngine.zip - # asset_content_type: application/zip - - # - name: Upload Unity plugin - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.create_draft.outputs.upload_url }} - # asset_path: ./Unity.zip - # asset_name: Unity.zip - # asset_content_type: application/zip - - # - name: Upload Godot plugin - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.create_draft.outputs.upload_url }} - # asset_path: ./Godot.zip - # asset_name: Godot.zip - # asset_content_type: application/zip + # - name: Create release draft + # uses: release-drafter/release-drafter@v5 + # id: create_draft + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # - name: Archive UnrealEngine plugin + # run: Compress-Archive -Path "Plugins/UnrealEngine" -DestinationPath "UnrealEngine.zip" + + # - name: Archive Unity plugin + # run: Compress-Archive -Path "Plugins/Unity" -DestinationPath "Unity.zip" + + # - name: Archive Godot plugin + # run: Compress-Archive -Path "Plugins/Godot" -DestinationPath "Godot.zip" + + # - name: Upload Application + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ steps.create_draft.outputs.upload_url }} + # asset_path: ./BocchiTracker.zip + # asset_name: BocchiTracker.zip + # asset_content_type: application/zip + + # - name: Upload UnrealEngine plugin + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ steps.create_draft.outputs.upload_url }} + # asset_path: ./UnrealEngine.zip + # asset_name: UnrealEngine.zip + # asset_content_type: application/zip + + # - name: Upload Unity plugin + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ steps.create_draft.outputs.upload_url }} + # asset_path: ./Unity.zip + # asset_name: Unity.zip + # asset_content_type: application/zip + + # - name: Upload Godot plugin + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ steps.create_draft.outputs.upload_url }} + # asset_path: ./Godot.zip + # asset_name: Godot.zip + # asset_content_type: application/zip