From a680db8930e1d9314a99a72dc13059b74d238e6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MATYSIAK=20Herv=C3=A9?= Date: Tue, 26 Dec 2023 13:31:09 +0700 Subject: [PATCH] ci(bg3): improve ci --- .github/workflows/main.yaml | 45 +++++++++++-------------------------- 1 file changed, 13 insertions(+), 32 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 5222c847..3bb3b470 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -12,7 +12,7 @@ on: - master jobs: - build-net: + build: runs-on: windows-latest steps: - name: Checkout @@ -21,9 +21,8 @@ jobs: - name: Get LSLib shell: pwsh run: | - mkdir -p External/lslib - aria2c https://github.com/Norbyte/lslib/releases/download/v1.18.7/ExportTool-v1.18.7.zip -o lslib.zip - Expand-Archive -Path lslib.zip -DestinationPath External/lslib + Invoke-WebRequest -Uri https://github.com/Herve-M/lslib/releases/download/${{ vars.LSLIB_VERSION }}/lslib-release.zip -OutFile lslib.zip + Expand-Archive -Path lslib.zip -DestinationPath external/lslib - name: Build run: dotnet build BG3ModManager.sln -c Release -r win-x64 --nologo --self-contained false @@ -32,43 +31,25 @@ jobs: run: | python BuildRelease.py - - name: Uploading artifacts - uses: actions/upload-artifact@v2 + - name: Uploading artifact + uses: actions/upload-artifact@v4 with: name: BUILD path: ./BG3ModManager_Latest.zip release: runs-on: ubuntu-latest - needs: build-net - if: ${{ github.event_name != 'pull_request' }} + needs: build + if: ${{ startsWith(github.ref, 'refs/tags/') }} steps: - - name: Create github release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - draft: ${{ !startsWith(github.ref, 'refs/tags/v') }} - prerelease: false - - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 id: download with: name: BUILD - path: ./BUILD - - - name: 'Echo download path' - if: env.ACTIONS_STEP_DEBUG - run: echo ${{steps.download.outputs.download-path}} - - name: Uploading artifacts to release - uses: xresloader/upload-to-github-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') with: - file: ${{ steps.download.outputs.download-path }} - release_id: ${{ steps.create_release.outputs.id }} - overwrite: true - verbose: env.ACTIONS_STEP_DEBUG \ No newline at end of file + files: | + ${{steps.download.outputs.download-path}}/BG3ModManager_Latest.zip \ No newline at end of file