From d37b46c588c819aea93f783159369577a9668a76 Mon Sep 17 00:00:00 2001 From: Thomas Bateson Date: Sat, 29 Apr 2023 02:29:10 -0500 Subject: [PATCH] Add GitHub workflows --- .github/workflows/build.yml | 25 +++++++++++++++++++++++++ .github/workflows/codeql.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..cd0fbd3c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +name: Build + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + runs-on: windows-2022 + steps: + - uses: actions/checkout@v3 + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 7.0.x + - name: Build + run: | + dotnet build app/GHelper.sln diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..96a191b0 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,28 @@ +name: CodeQL + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + schedule: + - cron: '34 18 * * 3' + +permissions: + actions: read + contents: read + security-events: write + +jobs: + codeql: + runs-on: windows-2022 + steps: + - uses: actions/checkout@v3 + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: c# + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + - name: Analyze + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..ad257d74 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Release + +on: + release: + types: [ published ] + +permissions: + contents: write + +jobs: + release: + runs-on: windows-2022 + steps: + - uses: actions/checkout@v3 + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 7.0.x + - name: Publish + run: | + dotnet publish app/GHelper.sln --configuration Release --runtime win-x64 -p:PublishSingleFile=true --no-self-contained + powershell Compress-Archive app/bin/x64/Release/net7.0-windows8.0/win-x64/publish/GHelper.exe GHelper.zip + - name: Upload + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release upload ${{ github.ref_name }} app/bin/x64/Release/net7.0-windows8.0/win-x64/publish/GHelper.exe GHelper.zip