Skip to content

Commit fd37ed8

Browse files
authored
chore(ci): standardize workflows (build, publish, preview-changelog, contributors) (#81)
- Rename ci.yml to build.yml, add workflow_dispatch trigger - Remove check-dist.yml (dist rebuilt during publish only) - Add preview-changelog.yml for release notes preview - Add publish.yml with dist rebuild, GitHub release, social notifications - Add contributors.yml for automated contributor updates - Refresh README with badges, emojis, and contributors section
1 parent 258c805 commit fd37ed8

File tree

6 files changed

+179
-97
lines changed

6 files changed

+179
-97
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
name: Continuous Integration
1+
name: Build
22

33
on:
4+
workflow_dispatch:
45
pull_request:
56
branches:
67
- main

.github/workflows/check-dist.yml

Lines changed: 0 additions & 72 deletions
This file was deleted.

.github/workflows/contributors.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Update Contributors
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
contributors:
10+
uses: CodingWithCalvin/.github/.github/workflows/contributors.yml@main
11+
secrets: inherit
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Preview Changelog
2+
3+
run-name: Preview release notes for next release
4+
5+
on:
6+
workflow_dispatch:
7+
8+
jobs:
9+
generate:
10+
name: Generate
11+
uses: CodingWithCalvin/.github/.github/workflows/generate-changelog.yml@main
12+
secrets: inherit
13+
14+
preview:
15+
name: Display Preview
16+
runs-on: ubuntu-latest
17+
needs: generate
18+
19+
steps:
20+
- name: Display changelog preview
21+
run: |
22+
echo "=========================================="
23+
echo "CHANGELOG PREVIEW"
24+
echo "=========================================="
25+
echo ""
26+
echo "${{ needs.generate.outputs.changelog }}"
27+
shell: bash

.github/workflows/publish.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Publish
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to release (e.g., 1.2.0)'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
changelog:
13+
uses: CodingWithCalvin/.github/.github/workflows/generate-changelog.yml@main
14+
secrets: inherit
15+
16+
release:
17+
needs: changelog
18+
runs-on: ubuntu-latest
19+
outputs:
20+
version: ${{ inputs.version }}
21+
22+
permissions:
23+
contents: write
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version-file: .node-version
33+
cache: npm
34+
35+
- name: Install Dependencies
36+
run: npm ci
37+
38+
- name: Rebuild dist
39+
run: npm run bundle
40+
41+
- name: Commit dist changes
42+
run: |
43+
git config user.name "github-actions[bot]"
44+
git config user.email "github-actions[bot]@users.noreply.github.com"
45+
git add dist/
46+
git diff --staged --quiet || git commit -m "chore: rebuild dist for v${{ inputs.version }}"
47+
git push
48+
49+
- name: Create and push tag
50+
run: |
51+
git tag v${{ inputs.version }}
52+
git push origin v${{ inputs.version }}
53+
54+
- name: Create GitHub Release
55+
uses: softprops/action-gh-release@v1
56+
with:
57+
tag_name: v${{ inputs.version }}
58+
name: v${{ inputs.version }}
59+
body: ${{ needs.changelog.outputs.changelog }}
60+
61+
notify-bluesky:
62+
needs: release
63+
uses: CodingWithCalvin/.github/.github/workflows/bluesky-post.yml@main
64+
with:
65+
post_text: |
66+
🚀 Visual Studio VSIX Versioner v${{ needs.release.outputs.version }} has been released!
67+
68+
Version your Visual Studio extensions with ease!
69+
70+
[📋 Release Notes](https://github.com/${{ github.repository }}/releases/tag/v${{ needs.release.outputs.version }})
71+
[📦 GitHub Marketplace](https://github.com/marketplace/actions/visual-studio-vsix-versioner)
72+
73+
#github #githubactions #devops #automation
74+
embed_url: https://github.com/marketplace/actions/visual-studio-vsix-versioner
75+
embed_title: Visual Studio VSIX Versioner
76+
embed_description: Version your Visual Studio extensions with ease!
77+
secrets:
78+
BLUESKY_USERNAME: ${{ secrets.BLUESKY_USERNAME }}
79+
BLUESKY_APP_PASSWORD: ${{ secrets.BLUESKY_APP_PASSWORD }}
80+
81+
notify-linkedin:
82+
needs: release
83+
uses: CodingWithCalvin/.github/.github/workflows/linkedin-post.yml@main
84+
with:
85+
post_text: |
86+
🚀 Visual Studio VSIX Versioner v${{ needs.release.outputs.version }} has been released!
87+
88+
Version your Visual Studio extensions with ease!
89+
90+
📋 Release Notes: https://github.com/${{ github.repository }}/releases/tag/v${{ needs.release.outputs.version }}
91+
📦 GitHub Marketplace: https://github.com/marketplace/actions/visual-studio-vsix-versioner
92+
93+
#github #githubactions #devops #automation
94+
article_url: https://github.com/marketplace/actions/visual-studio-vsix-versioner
95+
article_title: Visual Studio VSIX Versioner
96+
article_description: Version your Visual Studio extensions with ease!
97+
secrets:
98+
LINKEDIN_ACCESS_TOKEN: ${{ secrets.LINKEDIN_ACCESS_TOKEN }}
99+
LINKEDIN_CLIENT_ID: ${{ secrets.LINKEDIN_CLIENT_ID }}

README.md

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,60 @@
1-
# CodingWithCalvin/GHA-VSVsixVersioner
1+
# Visual Studio VSIX Versioner
22

3-
GitHub Action to update your Visual Studio extension to a version that is based
4-
off of the current date and the CI build number.
3+
[![Build](https://img.shields.io/github/actions/workflow/status/CodingWithCalvin/GHA-VSVsixVersioner/build.yml?style=for-the-badge&label=Build)](https://github.com/CodingWithCalvin/GHA-VSVsixVersioner/actions/workflows/build.yml)
4+
[![GitHub release](https://img.shields.io/github/v/release/CodingWithCalvin/GHA-VSVsixVersioner?style=for-the-badge)](https://github.com/CodingWithCalvin/GHA-VSVsixVersioner/releases)
5+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow?style=for-the-badge)](LICENSE)
56

6-
> _This action requires your extension to utilize the
7-
> [VSIX Synchronizer](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.VsixSynchronizer64)
8-
> model for managing the version in the `source.extension.vsixmanifest` and the
9-
> `source.extension.cs` code-behind file that is automatically synchronized._
7+
🏷️ Version your Visual Studio extensions automatically based on date and build number!
8+
9+
This GitHub Action updates your Visual Studio extension to a version based on the current date and CI build number.
10+
11+
## 🚀 Usage
12+
13+
You can use the Visual Studio VSIX Versioner GitHub Action by configuring a YAML-based workflow file, e.g. `.github/workflows/deploy.yml`.
14+
15+
> ⚠️ **Note:** This action requires your extension to utilize the [VSIX Synchronizer](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.VsixSynchronizer64) model for managing the version in the `source.extension.vsixmanifest` and the `source.extension.cs` code-behind file that is automatically synchronized.
1016
>
11-
> _Other versioning styles will be supported in the future_
17+
> Other versioning styles will be supported in the future.
18+
19+
> ⚠️ **Note:** This action only works on a Windows-based runner.
1220
13-
## Usage
21+
## 📥 Inputs
1422

15-
You can use the Visual Studio VSIX Versioner GitHub Action by configuring a
16-
YAML-based workflow file, e.g. .github/workflows/deploy.yml.
23+
| Input | Required | Description |
24+
|-------|----------|-------------|
25+
| `extension-manifest-file` | Yes | Path to your `source.extension.vsixmanifest` file |
26+
| `extension-source-file` | Yes | Path to the source file generated from the manifest (using VSIX Synchronizer) |
27+
| `build-number` | No | Build number to use for versioning (defaults to `run_number`) |
1728

18-
> _This action only works on a Windows-based runner_
29+
## 📋 Example
1930

20-
## Version the VSIX _before_ building
31+
Version the VSIX **before** building:
2132

22-
```yml
33+
```yaml
2334
steps:
2435
- name: Checkout
25-
uses: actions/checkout@v2
36+
uses: actions/checkout@v4
2637

2738
- name: Visual Studio VSIX Versioner
28-
uses: CodingWithCalvin/GHA-VSVsixVersioner@v2.0.0
39+
uses: CodingWithCalvin/GHA-VSVsixVersioner@v2
2940
with:
3041
# REQUIRED
31-
extension-manifest-file: './src/CodingWithCalvin.OpenBinFolder.Vsix/source.extension.vsixmanifest'
32-
extension-source-file: './src/CodingWithCalvin.OpenBinFolder.Vsix/source.extension.cs'
42+
extension-manifest-file: './src/MyExtension/source.extension.vsixmanifest'
43+
extension-source-file: './src/MyExtension/source.extension.cs'
3344

3445
# OPTIONAL
3546
build-number: ${{ github.run_number }}
3647
```
3748
38-
## Inputs
49+
## 👥 Contributors
50+
51+
<!-- readme: contributors -start -->
52+
<!-- readme: contributors -end -->
53+
54+
## 📄 License
55+
56+
MIT License - see [LICENSE](LICENSE) for details.
57+
58+
---
3959
40-
| Input | Required | Description |
41-
| ----------------------- | -------- | ----------------------------------------------------------------------------------------------------------- |
42-
| extension-manifest-file | Y | Path to the manifest used for the extension |
43-
| extension-source-file | Y | Path to the source file generated from the manifest (using VSIX Syncronizer) |
44-
| build-number | N | Specify the build number you'd like to utilize, otherwise, defaults to the `run_number` of the build itself |
60+
Made with ❤️ by Coding With Calvin

0 commit comments

Comments
 (0)