From 586b371949e9973460b1ecfb76591ecf5f90b891 Mon Sep 17 00:00:00 2001 From: AngaBlue Date: Thu, 2 Jun 2022 00:14:39 +1000 Subject: [PATCH] Updated release script --- .github/workflows/msbuild.yml | 51 ----------------------------------- .github/workflows/release.yml | 43 +++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 51 deletions(-) delete mode 100644 .github/workflows/msbuild.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml deleted file mode 100644 index a4e4bb0..0000000 --- a/.github/workflows/msbuild.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: MSBuild - -on: - push: - tags: - - 'v*' - -env: - # Path to the solution file relative to the root of the project. - SOLUTION_FILE_PATH: ./DemoDemon.sln - - # Configuration type to build. - # You can convert this to a build matrix if you need coverage of multiple configuration types. - # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - BUILD_CONFIGURATION: Release - -permissions: - contents: read - -jobs: - build: - runs-on: windows-latest - - steps: - - uses: actions/checkout@v3 - - - name: Clone BakkesmodSDK - uses: actions/checkout@v3 - with: - repository: bakkesmodorg/BakkesModSDK - path: D:\a\demo-demon\demo-demon\bakkesmodsdk - - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1.0.2 - - - name: Restore NuGet packages - working-directory: ${{env.GITHUB_WORKSPACE}} - run: nuget restore ${{env.SOLUTION_FILE_PATH}} - - - name: Build - working-directory: ${{env.GITHUB_WORKSPACE}} - # Add additional options to the MSBuild command line here (like platform or verbosity level). - # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference - run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:BakkesModPath=D:\a\demo-demon\demo-demon /p:Environment=GitHub ${{env.SOLUTION_FILE_PATH}} - - - name: Create Release - uses: softprops/action-gh-release@v1 - with: - files: D:\a\demo-demon\demo-demon\plugins\DemoDemon.dll - env: - GITHUB_TOKEN: ${{ secrets.PAT }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2129159 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Release + +# The workflow will be run when a commit is tagged with a version number +on: + push: + tags: + - 'v*' + +env: + SOLUTION_NAME: DemoDemon + +permissions: + contents: write + packages: write + +jobs: + build: + runs-on: windows-latest + + steps: + - name: Clone Repository + uses: actions/checkout@v3 + with: + path: plugin + + - name: Clone BakkesmodSDK + uses: actions/checkout@v3 + with: + repository: bakkesmodorg/BakkesModSDK + path: plugin\bakkesmodsdk + + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Build + run: msbuild /m /p:Configuration=Release /p:BakkesModPath=$env:GITHUB_WORKSPACE\plugin /p:Environment=GitHub $env:GITHUB_WORKSPACE\plugin\${{ env.SOLUTION_NAME }}.sln + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + files: ${{ github.workspace }}\plugin\plugins\${{ env.SOLUTION_NAME }}.dll + env: + GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}