Skip to content

Commit 2fa637a

Browse files
committed
chore(workflow): use shared build workflow
1 parent b1e9d6e commit 2fa637a

1 file changed

Lines changed: 4 additions & 44 deletions

File tree

.github/workflows/build.yml

Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -16,49 +16,9 @@ on:
1616
- '*.slnx'
1717
- '.github/workflows/build.yml'
1818

19-
env:
20-
PROJECT_PATH: src/CodingWithCalvin.OpenInNotepadPlusPlus/CodingWithCalvin.OpenInNotepadPlusPlus.csproj
21-
OUTPUT_PATH: src/CodingWithCalvin.OpenInNotepadPlusPlus/bin/Release
22-
INFO_FILE: CodingWithCalvin.OpenInNotepadPlusPlus.info
23-
VSIX_FILE: CodingWithCalvin.OpenInNotepadPlusPlus.vsix
24-
2519
jobs:
2620
build:
27-
runs-on: windows-latest
28-
29-
steps:
30-
- uses: actions/checkout@v4
31-
32-
- name: 1. Generate Version
33-
id: version
34-
run: |
35-
$year = (Get-Date).Year
36-
$month = (Get-Date).Month
37-
$day = (Get-Date).Day
38-
$version = "$year.$month.$day.${{ github.run_number }}"
39-
echo "version=$version" >> $env:GITHUB_OUTPUT
40-
shell: pwsh
41-
42-
- name: 2. Inject Honeycomb API Key
43-
run: |
44-
$file = 'src/CodingWithCalvin.OpenInNotepadPlusPlus/HoneycombConfig.cs'
45-
$content = Get-Content $file -Raw
46-
$content = $content -replace 'PLACEHOLDER', '${{ secrets.HONEYCOMB_API_KEY }}'
47-
Set-Content $file $content
48-
shell: pwsh
49-
50-
- name: 3. Build Project
51-
run: dotnet build ${{ env.PROJECT_PATH }} -c Release -p:SetVsixVersion=${{ steps.version.outputs.version }}
52-
53-
- name: 4. Create Information File
54-
uses: jsdaniell/create-json@v1.2.3
55-
with:
56-
name: '${{ env.OUTPUT_PATH }}/${{ env.INFO_FILE }}'
57-
json: '{"sha":"${{ github.sha }}", "version":"${{ steps.version.outputs.version }}"}'
58-
59-
- name: 5. Upload Artifact
60-
uses: actions/upload-artifact@v4
61-
with:
62-
path: |
63-
${{ env.OUTPUT_PATH }}/${{ env.INFO_FILE }}
64-
${{ env.OUTPUT_PATH }}/${{ env.VSIX_FILE }}
21+
uses: CodingWithCalvin/.github/.github/workflows/vsix-build.yml@main
22+
with:
23+
extension-name: OpenInNotepadPlusPlus
24+
secrets: inherit

0 commit comments

Comments
 (0)