From c1afd463ead16e35f8f592d13ce24456d6ccc758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brandon=F0=9F=8C=A9=EF=B8=8FH?= Date: Wed, 12 Jun 2024 14:32:56 -0700 Subject: [PATCH] Splitting into separate workflows, reusing build & test portions # Conflicts: # .github/workflows/build-and-test.yml --- .github/workflows/build-and-test.yml | 5 +-- .github/workflows/publish-extension.yml | 57 +++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/publish-extension.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index bebe588..e446581 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,14 +1,11 @@ name: Build and Test on: - push: - branches: - - main pull_request: branches: - main workflow_dispatch: - + workflow_call: jobs: build-and-test: runs-on: windows-latest diff --git a/.github/workflows/publish-extension.yml b/.github/workflows/publish-extension.yml new file mode 100644 index 0000000..3045dbb --- /dev/null +++ b/.github/workflows/publish-extension.yml @@ -0,0 +1,57 @@ +name: Publish Extension + +on: + push: + branches: + - main + workflow_dispatch: + +env: + EXTENSION_VERSION: 1.0.${{ github.run_number }} + +jobs: + build-and-test: + uses: ./.github/workflows/build-and-test.yml + + publish-to-marketplace: + needs: build-and-test + runs-on: ubuntu-latest + + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: DocGPT.vsix + path: ./DocGPT.vsix + + - name: Publish to marketplace + uses: cezarypiatek/VsixPublisherAction@1.1 + with: + extension-file: ./DocGPT.vsix + publish-manifest-file: ./DocGpt.Vsix/publishmanifest.json + personal-access-code: ${{ secrets.MARKETPLACE_PAT }} + + publish-release: + needs: build-and-test + runs-on: ubuntu-latest + permissions: write-all + + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: DocGPT.vsix + path: ./DocGPT.vsix + + - name: Create Release + run: | + gh release create --target "${{ github.sha }}" \ + --title "v${{ env.EXTENSION_VERSION }}" \ + --generate-notes + --draft + + - name: Upload Release Asset + run: | + gh release upload "v${{ env.EXTENSION_VERSION }}" \ + --file ./DocGPT.vsix#Installer \ + --clobber