Skip to content

Commit

Permalink
ci(bg3): improve ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Herve-M committed Dec 26, 2023
1 parent 983867a commit a680db8
Showing 1 changed file with 13 additions and 32 deletions.
45 changes: 13 additions & 32 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- master

jobs:
build-net:
build:
runs-on: windows-latest
steps:
- name: Checkout
Expand All @@ -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
Expand All @@ -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
files: |
${{steps.download.outputs.download-path}}/BG3ModManager_Latest.zip

0 comments on commit a680db8

Please sign in to comment.