Skip to content

Commit 1304c76

Browse files
committed
chore(workflow): use shared workflows
1 parent 4cac573 commit 1304c76

File tree

2 files changed

+24
-73
lines changed

2 files changed

+24
-73
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,21 @@ on:
44
workflow_dispatch:
55
pull_request:
66
types: [opened, reopened]
7+
paths:
8+
- 'src/**'
9+
- '*.slnx'
10+
- '.github/workflows/build.yml'
711
push:
812
branches:
913
- main
14+
paths:
15+
- 'src/**'
16+
- '*.slnx'
17+
- '.github/workflows/build.yml'
1018

1119
jobs:
1220
build:
13-
runs-on: windows-latest
14-
15-
steps:
16-
- uses: actions/checkout@v4
17-
18-
- name: 1. Generate Version
19-
id: version
20-
run: |
21-
$year = (Get-Date).Year
22-
$month = (Get-Date).Month
23-
$day = (Get-Date).Day
24-
$version = "$year.$month.$day.${{ github.run_number }}"
25-
echo "version=$version" >> $env:GITHUB_OUTPUT
26-
shell: pwsh
27-
28-
- name: 2. Build Project
29-
run: dotnet build src/CodingWithCalvin.BreakpointNotifier/CodingWithCalvin.BreakpointNotifier.csproj -c Release -p:SetVsixVersion=${{ steps.version.outputs.version }}
30-
31-
- name: 3. Create Information File
32-
uses: jsdaniell/create-json@v1.2.3
33-
with:
34-
name: 'src/CodingWithCalvin.BreakpointNotifier/bin/Release/CodingWithCalvin.BreakpointNotifier.info'
35-
json: '{"sha":"${{ github.sha }}", "version":"${{ steps.version.outputs.version }}"}'
36-
37-
- name: 4. Upload Artifact
38-
uses: actions/upload-artifact@v4
39-
with:
40-
path: |
41-
src/CodingWithCalvin.BreakpointNotifier/bin/Release/CodingWithCalvin.BreakpointNotifier.info
42-
src/CodingWithCalvin.BreakpointNotifier/bin/Release/CodingWithCalvin.BreakpointNotifier.vsix
21+
uses: CodingWithCalvin/.github/.github/workflows/vsix-build.yml@main
22+
with:
23+
extension-name: BreakpointNotifier
24+
secrets: inherit

.github/workflows/publish.yml

Lines changed: 12 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,17 @@ name: Publish to VS Marketplace
33
on:
44
workflow_dispatch:
55

6-
jobs:
7-
changelog:
8-
name: Generate Changelog
9-
uses: CodingWithCalvin/.github/.github/workflows/generate-changelog.yml@main
6+
permissions:
7+
contents: write
8+
actions: read
109

10+
jobs:
1111
publish:
12-
needs: changelog
13-
runs-on: windows-latest
14-
permissions:
15-
contents: write
16-
steps:
17-
- name: Checkout
18-
uses: actions/checkout@v4
19-
20-
- name: 1. Download artifact
21-
id: download-artifact
22-
uses: dawidd6/action-download-artifact@v6
23-
with:
24-
workflow: build.yml
25-
workflow_conclusion: success
26-
27-
- name: 2. Parse Artifact Manifest
28-
id: artifact_manifest
29-
uses: ActionsTools/read-json-action@main
30-
with:
31-
file_path: ./artifact/CodingWithCalvin.BreakpointNotifier.info
32-
33-
- name: 3. Create Tag & Release
34-
uses: ncipollo/release-action@v1.14.0
35-
with:
36-
artifacts: ./artifact/CodingWithCalvin.BreakpointNotifier.vsix
37-
body: ${{ needs.changelog.outputs.changelog }}
38-
makeLatest: true
39-
commit: ${{ steps.artifact_manifest.outputs.sha }}
40-
tag: ${{ steps.artifact_manifest.outputs.version }}
41-
42-
- name: 4. Publish Release to Marketplace
43-
if: success()
44-
uses: CodingWithCalvin/GHA-VSMarketplacePublisher@v1
45-
with:
46-
marketplace-pat: ${{ secrets.VS_PAT }}
47-
publish-manifest-path: ./resources/extension.manifest.json
48-
vsix-path: ./artifact/CodingWithCalvin.BreakpointNotifier.vsix
49-
50-
12+
uses: CodingWithCalvin/.github/.github/workflows/vsix-publish.yml@main
13+
with:
14+
extension-name: BreakpointNotifier
15+
display-name: 'Breakpoint Notifier'
16+
marketplace-id: CodingWithCalvin.VS-BreakpointNotifier
17+
description: 'Opens a dialog box when a breakpoint is hit - great for multi-tasking!'
18+
hashtags: '#debugging'
19+
secrets: inherit

0 commit comments

Comments
 (0)