From 12b33969136027db508141f3e700b4a52ad703b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MATYSIAK=20Herv=C3=A9?= Date: Thu, 21 Dec 2023 22:25:15 +0700 Subject: [PATCH] ci: initial CI & CD --- .github/workflows/main.yaml | 57 +++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/main.yaml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 00000000..469f3eae --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,57 @@ +name: main + +on: + push: + branches: + - master + tags: + - '*' + pull_request: + branches: + - master + +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Get LSLib + shell: pwsh + run: | + Invoke-WebRequest -Uri https://github.com/${{ vars.LSLIB_GITHUB }}/releases/download/${{ vars.LSLIB_VERSION }}/lslib-release.zip -OutFile lslib.zip + Expand-Archive -Path lslib.zip -DestinationPath external/lslib + + - uses: actions/setup-dotnet@v3 + with: + dotnet-version: '7.x' + + - name: Restore + run: dotnet restore BG3ModManager.sln + + - name: Build + run: dotnet msbuild BG3ModManager.sln -p:Configuration=Publish + + - name: Uploading artifact + uses: actions/upload-artifact@v4 + with: + name: BUILD + path: ./BG3ModManager_Latest.zip + + release: + runs-on: ubuntu-latest + needs: build + if: ${{ startsWith(github.ref, 'refs/tags/') }} + steps: + - uses: actions/download-artifact@v4 + id: download + with: + name: BUILD + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + ${{steps.download.outputs.download-path}}/BG3ModManager_Latest.zip \ No newline at end of file