From 0beeaa2e6625bc6712c388d53b33cea92a48c4ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brandon=F0=9F=8C=A9=EF=B8=8FH?= Date: Fri, 19 Jul 2024 16:10:21 -0700 Subject: [PATCH 1/2] Updating pr build workflow to react to comments --- .github/workflows/pr-build.yaml | 52 +++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml index fae7adf..5c61e68 100644 --- a/.github/workflows/pr-build.yaml +++ b/.github/workflows/pr-build.yaml @@ -6,11 +6,28 @@ on: paths-ignore: - "**.md" - "LICENSE" + issue_comment: + types: [created] jobs: + isCodeOwner: + if: github.event.issue.pull_request && contains(github.event.comment.body, '/test-pack') + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Check if comment author is a code owner + id: check + run: | + CODEOWNERS=$(cat .github/CODEOWNERS) + COMMENT_AUTHOR=${{ github.event.comment.user.login }} + if echo "$CODEOWNERS" | grep -q "$COMMENT_AUTHOR"; then + echo "::set-output name=isCodeOwner::true" + else + echo "::set-output name=isCodeOwner::false" + fi build-release: runs-on: windows-latest - needs: [] steps: - uses: actions/checkout@v4 @@ -21,9 +38,40 @@ jobs: - name: dotnet build run: dotnet build -c release + + - name: dotnet publish + if: steps.isCodeOwner.outputs.isCodeOwner == 'true' + run: dotnet publish -o pub -c release -p:PublishSingleFile=true -p:Version=${{ env.APP_VERSION }} + + - name: Upload binaries + if: steps.isCodeOwner.outputs.isCodeOwner == 'true' + uses: actions/upload-artifact@v4 + with: + name: binaries + path: pub/FileSorter.* + choco-pack: + needs: build-release + if: steps.isCodeOwner.outputs.isCodeOwner == 'true' + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - name: Download a single artifact + uses: actions/download-artifact@v4 + with: + name: binaries + path: bin + + - name: Package + run: cd choco && choco pack --version ${{ env.APP_VERSION }} + + - name: Upload nupkg + uses: actions/upload-artifact@v4 + with: + name: nupkg + path: choco/*.nupkg build-debug: runs-on: windows-latest - needs: [] steps: - uses: actions/checkout@v4 From 0f231e2e38e03ce30a5294d2a5ea73c072b242e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brandon=F0=9F=8C=A9=EF=B8=8FH?= Date: Fri, 19 Jul 2024 16:11:26 -0700 Subject: [PATCH 2/2] Adding CODEOWNERS --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..9d7347b --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* bc3tech \ No newline at end of file