From 92ed8f680b9e3bedb866420fa32b8693ea46b58f Mon Sep 17 00:00:00 2001 From: "Calvin A. Allen" Date: Fri, 2 Jan 2026 21:54:39 -0500 Subject: [PATCH] chore(workflow): use shared workflows --- .github/workflows/build.yml | 42 +++++------------- .github/workflows/publish.yml | 82 +++-------------------------------- 2 files changed, 19 insertions(+), 105 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 200a91f..2e28eaf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,39 +4,21 @@ on: workflow_dispatch: pull_request: types: [opened, reopened] + paths: + - 'src/**' + - '*.slnx' + - '.github/workflows/build.yml' push: branches: - main + paths: + - 'src/**' + - '*.slnx' + - '.github/workflows/build.yml' jobs: build: - runs-on: windows-latest - - steps: - - uses: actions/checkout@v4 - - - name: 1. Generate Version - id: version - run: | - $year = (Get-Date).Year - $month = (Get-Date).Month - $day = (Get-Date).Day - $version = "$year.$month.$day.${{ github.run_number }}" - echo "version=$version" >> $env:GITHUB_OUTPUT - shell: pwsh - - - name: 2. Build Project - run: dotnet build src/CodingWithCalvin.GitRanger/CodingWithCalvin.GitRanger.csproj -c Release -p:SetVsixVersion=${{ steps.version.outputs.version }} - - - name: 3. Create Information File - uses: jsdaniell/create-json@v1.2.3 - with: - name: 'src/CodingWithCalvin.GitRanger/bin/Release/CodingWithCalvin.GitRanger.info' - json: '{"sha":"${{ github.sha }}", "version":"${{ steps.version.outputs.version }}"}' - - - name: 4. Upload Artifact - uses: actions/upload-artifact@v4 - with: - path: | - src/CodingWithCalvin.GitRanger/bin/Release/CodingWithCalvin.GitRanger.info - src/CodingWithCalvin.GitRanger/bin/Release/CodingWithCalvin.GitRanger.vsix + uses: CodingWithCalvin/.github/.github/workflows/vsix-build.yml@main + with: + extension-name: GitRanger + secrets: inherit diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 647a4c3..ecef884 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,80 +8,12 @@ permissions: actions: read jobs: - changelog: - name: Generate Changelog - uses: CodingWithCalvin/.github/.github/workflows/generate-changelog.yml@main - secrets: inherit - publish: - needs: changelog - runs-on: windows-latest - outputs: - version: ${{ steps.artifact_manifest.outputs.version }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: 1. Download artifact - id: download-artifact - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build.yml - workflow_conclusion: success - - - name: 2. Parse Artifact Manifest - id: artifact_manifest - uses: ActionsTools/read-json-action@main - with: - file_path: ./artifact/CodingWithCalvin.GitRanger.info - - - name: 3. Create Tag & Release - uses: ncipollo/release-action@v1.14.0 - with: - artifacts: ./artifact/CodingWithCalvin.GitRanger.vsix - body: ${{ needs.changelog.outputs.changelog }} - makeLatest: true - commit: ${{ steps.artifact_manifest.outputs.sha }} - tag: ${{ steps.artifact_manifest.outputs.version }} - - - name: 4. Publish Release to Marketplace - if: success() - uses: CodingWithCalvin/GHA-VSMarketplacePublisher@v1 - with: - marketplace-pat: ${{ secrets.VS_PAT }} - publish-manifest-path: ./resources/extension.manifest.json - vsix-path: ./artifact/CodingWithCalvin.GitRanger.vsix - - notify-bluesky: - needs: publish - uses: CodingWithCalvin/.github/.github/workflows/bluesky-post.yml@main + uses: CodingWithCalvin/.github/.github/workflows/vsix-publish.yml@main with: - post_text: | - 🚀 Git Ranger v${{ needs.publish.outputs.version }} for #VisualStudio has been released! - - [Check out the release notes here!](https://github.com/${{ github.repository }}/releases/tag/${{ needs.publish.outputs.version }}) - - #dotnet #csharp #visualstudio - embed_url: https://marketplace.visualstudio.com/items?itemName=CodingWithCalvin.VS-GitRanger - embed_title: Git Ranger for Visual Studio - embed_description: A visually stunning Git management extension for Visual Studio 2022/2026 - secrets: - BLUESKY_USERNAME: ${{ secrets.BLUESKY_USERNAME }} - BLUESKY_APP_PASSWORD: ${{ secrets.BLUESKY_APP_PASSWORD }} - - notify-linkedin: - needs: publish - uses: CodingWithCalvin/.github/.github/workflows/linkedin-post.yml@main - with: - post_text: | - 🚀 Git Ranger v${{ needs.publish.outputs.version }} for #VisualStudio has been released! - - Check out the release notes: https://github.com/${{ github.repository }}/releases/tag/${{ needs.publish.outputs.version }} - - #dotnet #csharp #visualstudio - article_url: https://marketplace.visualstudio.com/items?itemName=CodingWithCalvin.VS-GitRanger - article_title: Git Ranger for Visual Studio - article_description: A visually stunning Git management extension for Visual Studio 2022/2026 - secrets: - LINKEDIN_ACCESS_TOKEN: ${{ secrets.LINKEDIN_ACCESS_TOKEN }} - LINKEDIN_CLIENT_ID: ${{ secrets.LINKEDIN_CLIENT_ID }} + extension-name: GitRanger + display-name: 'Git Ranger' + marketplace-id: CodingWithCalvin.VS-GitRanger + description: 'A visually stunning Git management extension for Visual Studio 2022/2026' + hashtags: '#git' + secrets: inherit