From 168e20afb1e81ed9169a9ef1c5de8deb58f68b54 Mon Sep 17 00:00:00 2001 From: Ryan Caezar Itang Date: Mon, 21 Nov 2022 14:34:07 +0800 Subject: [PATCH 1/2] Add dependabot and build workflow --- .github/dependabot.yml | 14 ++++++++++++++ .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..44fbb83 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "nuget" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "gitsubmodule" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2aed9ed --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + strategy: + matrix: + configuration: [Debug, Release] + platform: [x64, x86] + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - uses: actions/setup-dotnet@v3 + with: + dotnet-version: '6.x' + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Publish + run: dotnet publish -p:PublishSingleFile=true -r win-${{ matrix.platform }} -c ${{ matrix.configuration }} --self-contained false .\Bloxstrap\Bloxstrap.csproj + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: Bloxstrap (${{ matrix.configuration }}, ${{ matrix.platform }}) + path: | + .\Bloxstrap\bin\${{ matrix.configuration }}\net6.0-windows\win-${{ matrix.platform }}\publish\* \ No newline at end of file From 40d764236ec71b23df88afe078dbb4c038c0be98 Mon Sep 17 00:00:00 2001 From: Ryan Caezar Itang Date: Mon, 21 Nov 2022 15:02:44 +0800 Subject: [PATCH 2/2] Add release job --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2aed9ed..102d14a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,10 @@ name: CI on: push: - branches: [ main ] + tags: + - 'v*' + branches: + - main pull_request: branches: [ main ] @@ -31,4 +34,33 @@ jobs: with: name: Bloxstrap (${{ matrix.configuration }}, ${{ matrix.platform }}) path: | - .\Bloxstrap\bin\${{ matrix.configuration }}\net6.0-windows\win-${{ matrix.platform }}\publish\* \ No newline at end of file + .\Bloxstrap\bin\${{ matrix.configuration }}\net6.0-windows\win-${{ matrix.platform }}\publish\* + + release: + needs: build + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + + steps: + - name: Download x64 release artifact + uses: actions/download-artifact@v3 + with: + name: Bloxstrap (Release, x64) + path: x64 + - name: Download x86 release artifact + uses: actions/download-artifact@v3 + with: + name: Bloxstrap (Release, x86) + path: x86 + - name: Rename binaries + run: | + mv x64/Bloxstrap.exe Bloxstrap-${{ github.ref_name }}-x64.exe + mv x86/Bloxstrap.exe Bloxstrap-${{ github.ref_name }}-x86.exe + - name: Release + uses: softprops/action-gh-release@v1 + with: + draft: true + files: | + Bloxstrap-${{ github.ref_name }}-x64.exe + Bloxstrap-${{ github.ref_name }}-x86.exe + name: Bloxstrap ${{ github.ref_name }}