Skip to content

Commit

Permalink
Splitting into separate workflows, reusing build & test portions
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/build-and-test.yml
  • Loading branch information
bc3tech committed Jun 12, 2024
1 parent 75d2637 commit c1afd46
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 4 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/publish-extension.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c1afd46

Please sign in to comment.