Skip to content

Commit d895fd5

Browse files
authored
chore(workflow): use shared workflows (#51)
1 parent 627dd9b commit d895fd5

File tree

2 files changed

+18
-85
lines changed

2 files changed

+18
-85
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.ProjectRenamifier/CodingWithCalvin.ProjectRenamifier.csproj -c Release -p:SetVsixVersion=${{ steps.version.outputs.version }}
30-
31-
- name: 3. Create Information File
32-
uses: jsdaniell/[email protected]
33-
with:
34-
name: 'src/CodingWithCalvin.ProjectRenamifier/bin/Release/CodingWithCalvin.ProjectRenamifier.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.ProjectRenamifier/bin/Release/CodingWithCalvin.ProjectRenamifier.info
42-
src/CodingWithCalvin.ProjectRenamifier/bin/Release/CodingWithCalvin.ProjectRenamifier.vsix
21+
uses: CodingWithCalvin/.github/.github/workflows/vsix-build.yml@main
22+
with:
23+
extension-name: ProjectRenamifier
24+
secrets: inherit

.github/workflows/publish.yml

Lines changed: 6 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -8,60 +8,11 @@ permissions:
88
actions: read
99

1010
jobs:
11-
changelog:
12-
name: Generate Changelog
13-
uses: CodingWithCalvin/.github/.github/workflows/generate-changelog.yml@main
14-
secrets: inherit
15-
1611
publish:
17-
needs: changelog
18-
runs-on: windows-latest
19-
outputs:
20-
version: ${{ steps.artifact_manifest.outputs.version }}
21-
steps:
22-
- name: Checkout
23-
uses: actions/checkout@v4
24-
25-
- name: 1. Download artifact
26-
id: download-artifact
27-
uses: dawidd6/action-download-artifact@v6
28-
with:
29-
workflow: build.yml
30-
workflow_conclusion: success
31-
32-
- name: 2. Parse Artifact Manifest
33-
id: artifact_manifest
34-
uses: ActionsTools/read-json-action@main
35-
with:
36-
file_path: ./artifact/CodingWithCalvin.ProjectRenamifier.info
37-
38-
- name: 3. Create Tag & Release
39-
uses: ncipollo/[email protected]
40-
with:
41-
artifacts: ./artifact/CodingWithCalvin.ProjectRenamifier.vsix
42-
body: ${{ needs.changelog.outputs.changelog }}
43-
makeLatest: true
44-
commit: ${{ steps.artifact_manifest.outputs.sha }}
45-
tag: ${{ steps.artifact_manifest.outputs.version }}
46-
47-
- name: 4. Publish Release to Marketplace
48-
if: success()
49-
uses: CodingWithCalvin/GHA-VSMarketplacePublisher@v1
50-
with:
51-
marketplace-pat: ${{ secrets.VS_PAT }}
52-
publish-manifest-path: ./resources/extension.manifest.json
53-
vsix-path: ./artifact/CodingWithCalvin.ProjectRenamifier.vsix
54-
55-
notify:
56-
needs: publish
57-
uses: CodingWithCalvin/.github/.github/workflows/bluesky-post.yml@main
12+
uses: CodingWithCalvin/.github/.github/workflows/vsix-publish.yml@main
5813
with:
59-
post_text: |
60-
🚀 Project Renamifier v${{ needs.publish.outputs.version }} for #VisualStudio has been released!
61-
62-
[Check out the release notes here!](https://github.com/${{ github.repository }}/releases/tag/${{ needs.publish.outputs.version }})
63-
64-
Marketplace: https://marketplace.visualstudio.com/items?itemName=CodingWithCalvin.VS-ProjectRenamifier
65-
secrets:
66-
BLUESKY_USERNAME: ${{ secrets.BLUESKY_USERNAME }}
67-
BLUESKY_APP_PASSWORD: ${{ secrets.BLUESKY_APP_PASSWORD }}
14+
extension-name: ProjectRenamifier
15+
display-name: 'Project Renamifier'
16+
marketplace-id: CodingWithCalvin.VS-ProjectRenamifier
17+
description: 'Safely rename projects in Visual Studio with namespace and reference updates'
18+
secrets: inherit

0 commit comments

Comments
 (0)