diff --git a/.github/workflows/ci.yml b/.github/workflows/build.yml similarity index 95% rename from .github/workflows/ci.yml rename to .github/workflows/build.yml index 1e6d223..657e1ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,7 @@ -name: Continuous Integration +name: Build on: + workflow_dispatch: pull_request: branches: - main diff --git a/.github/workflows/check-dist.yml b/.github/workflows/check-dist.yml deleted file mode 100644 index 5c4bd8b..0000000 --- a/.github/workflows/check-dist.yml +++ /dev/null @@ -1,72 +0,0 @@ -# In TypeScript actions, `dist/` is a special directory. When you reference -# an action with the `uses:` property, `dist/index.js` is the code that will be -# run. For this project, the `dist/index.js` file is transpiled from other -# source files. This workflow ensures the `dist/` directory contains the -# expected transpiled code. -# -# If this workflow is run from a feature branch, it will act as an additional CI -# check and fail if the checked-in `dist/` directory does not match what is -# expected from the build. -name: Check Transpiled JavaScript - -on: - pull_request: - branches: - - main - push: - branches: - - main - -permissions: - contents: read - -jobs: - check-dist: - name: Check dist/ - runs-on: ubuntu-latest - - steps: - - name: Checkout - id: checkout - uses: actions/checkout@v4 - - - name: Setup Node.js - id: setup-node - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - cache: npm - - - name: Install Dependencies - id: install - run: npm ci - - - name: Build dist/ Directory - id: build - run: npm run bundle - - # This will fail the workflow if the `dist/` directory is different than - # expected. - - name: Compare Directories - id: diff - run: | - if [ ! -d dist/ ]; then - echo "Expected dist/ directory does not exist. See status below:" - ls -la ./ - exit 1 - fi - if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then - echo "Detected uncommitted changes after build. See status below:" - git diff --ignore-space-at-eol --text dist/ - exit 1 - fi - - # If `dist/` was different than expected, upload the expected version as a - # workflow artifact. - - if: ${{ failure() && steps.diff.outcome == 'failure' }} - name: Upload Artifact - id: upload - uses: actions/upload-artifact@v4 - with: - name: dist - path: dist/ diff --git a/.github/workflows/contributors.yml b/.github/workflows/contributors.yml new file mode 100644 index 0000000..6c91a77 --- /dev/null +++ b/.github/workflows/contributors.yml @@ -0,0 +1,11 @@ +name: Update Contributors + +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +jobs: + contributors: + uses: CodingWithCalvin/.github/.github/workflows/contributors.yml@main + secrets: inherit diff --git a/.github/workflows/preview-changelog.yml b/.github/workflows/preview-changelog.yml new file mode 100644 index 0000000..91dac6e --- /dev/null +++ b/.github/workflows/preview-changelog.yml @@ -0,0 +1,27 @@ +name: Preview Changelog + +run-name: Preview release notes for next release + +on: + workflow_dispatch: + +jobs: + generate: + name: Generate + uses: CodingWithCalvin/.github/.github/workflows/generate-changelog.yml@main + secrets: inherit + + preview: + name: Display Preview + runs-on: ubuntu-latest + needs: generate + + steps: + - name: Display changelog preview + run: | + echo "==========================================" + echo "CHANGELOG PREVIEW" + echo "==========================================" + echo "" + echo "${{ needs.generate.outputs.changelog }}" + shell: bash diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..10e23ae --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,99 @@ +name: Publish + +on: + workflow_dispatch: + inputs: + version: + description: 'Version to release (e.g., 1.2.0)' + required: true + type: string + +jobs: + changelog: + uses: CodingWithCalvin/.github/.github/workflows/generate-changelog.yml@main + secrets: inherit + + release: + needs: changelog + runs-on: ubuntu-latest + outputs: + version: ${{ inputs.version }} + + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .node-version + cache: npm + + - name: Install Dependencies + run: npm ci + + - name: Rebuild dist + run: npm run bundle + + - name: Commit dist changes + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add dist/ + git diff --staged --quiet || git commit -m "chore: rebuild dist for v${{ inputs.version }}" + git push + + - name: Create and push tag + run: | + git tag v${{ inputs.version }} + git push origin v${{ inputs.version }} + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ inputs.version }} + name: v${{ inputs.version }} + body: ${{ needs.changelog.outputs.changelog }} + + notify-bluesky: + needs: release + uses: CodingWithCalvin/.github/.github/workflows/bluesky-post.yml@main + with: + post_text: | + 🚀 Visual Studio Marketplace Publisher v${{ needs.release.outputs.version }} has been released! + + Publish your Visual Studio extensions to the marketplace with ease! + + [📋 Release Notes](https://github.com/${{ github.repository }}/releases/tag/v${{ needs.release.outputs.version }}) + [📦 GitHub Marketplace](https://github.com/marketplace/actions/visual-studio-marketplace-publisher) + + #github #githubactions #devops #automation + embed_url: https://github.com/marketplace/actions/visual-studio-marketplace-publisher + embed_title: Visual Studio Marketplace Publisher + embed_description: Publish your Visual Studio extensions to the marketplace with ease! + secrets: + BLUESKY_USERNAME: ${{ secrets.BLUESKY_USERNAME }} + BLUESKY_APP_PASSWORD: ${{ secrets.BLUESKY_APP_PASSWORD }} + + notify-linkedin: + needs: release + uses: CodingWithCalvin/.github/.github/workflows/linkedin-post.yml@main + with: + post_text: | + 🚀 Visual Studio Marketplace Publisher v${{ needs.release.outputs.version }} has been released! + + Publish your Visual Studio extensions to the marketplace with ease! + + 📋 Release Notes: https://github.com/${{ github.repository }}/releases/tag/v${{ needs.release.outputs.version }} + 📦 GitHub Marketplace: https://github.com/marketplace/actions/visual-studio-marketplace-publisher + + #github #githubactions #devops #automation + article_url: https://github.com/marketplace/actions/visual-studio-marketplace-publisher + article_title: Visual Studio Marketplace Publisher + article_description: Publish your Visual Studio extensions to the marketplace with ease! + secrets: + LINKEDIN_ACCESS_TOKEN: ${{ secrets.LINKEDIN_ACCESS_TOKEN }} + LINKEDIN_CLIENT_ID: ${{ secrets.LINKEDIN_CLIENT_ID }} diff --git a/README.md b/README.md index 9173d39..6b89f42 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,60 @@ -# CodingWithCalvin/GHA-VSMarketplacePublisher +# Visual Studio Marketplace Publisher -Github Action to publish your Visual Studio extension to the marketplace +[![Build](https://img.shields.io/github/actions/workflow/status/CodingWithCalvin/GHA-VSMarketplacePublisher/build.yml?style=for-the-badge&label=Build)](https://github.com/CodingWithCalvin/GHA-VSMarketplacePublisher/actions/workflows/build.yml) +[![GitHub release](https://img.shields.io/github/v/release/CodingWithCalvin/GHA-VSMarketplacePublisher?style=for-the-badge)](https://github.com/CodingWithCalvin/GHA-VSMarketplacePublisher/releases) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow?style=for-the-badge)](LICENSE) -## Usage +📦 Publish your Visual Studio extensions to the marketplace with ease! -You can use the VS Marketplace Publish GitHub Action by configuring a YAML-based -workflow file, e.g. .github/workflows/deploy.yml. +This GitHub Action publishes your Visual Studio extension (.vsix) to the Visual Studio Marketplace. -> _This action only works on a Windows-based runner_ +## 🚀 Usage -## Publish a local VSIX File +You can use the Visual Studio Marketplace Publisher GitHub Action by configuring a YAML-based workflow file, e.g. `.github/workflows/deploy.yml`. -```yml +> ⚠️ **Note:** This action only works on a Windows-based runner. + +## 📥 Inputs + +| Input | Required | Description | +|-------|----------|-------------| +| `marketplace-pat` | Yes | Your Personal Access Token for the Visual Studio Marketplace | +| `publish-manifest-path` | Yes | Path to your publish manifest (JSON file) | +| `vsix-path` | Yes | Path to the local VSIX package to publish | +| `vs-version` | No | Version of Visual Studio tooling to use (default: `latest`) | +| `vs-prerelease` | No | Allow pre-release Visual Studio tooling (default: `false`) | + +## 📋 Example + +Publish a local VSIX file: + +```yaml steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Visual Studio Marketplace Publisher - uses: CodingWithCalvin/GHA-VSMarketplacePublisher@v2.0.0 + uses: CodingWithCalvin/GHA-VSMarketplacePublisher@v2 with: # REQUIRED - marketplace-pat: ${{ secrets.vs_pat }} - publish-manifest-path: ./src/vsixManifest.json - vsix-path: ./src/outputFolder/Extension.vsix + marketplace-pat: ${{ secrets.VS_MARKETPLACE_PAT }} + publish-manifest-path: './src/vsixManifest.json' + vsix-path: './src/outputFolder/Extension.vsix' # OPTIONAL vs-version: latest vs-prerelease: false ``` -## Inputs +## 👥 Contributors + + + + +## 📄 License + +MIT License - see [LICENSE](LICENSE) for details. + +--- -| Input | Required | Description | -| --------------------- | -------- | -------------------------------------------------------------------------------- | -| marketplace-pat | Y | Your 'Personal Access Token' to perform actions on the Visual Studio Marketplace | -| publish-manifest-path | Y | Path to the manifest used for the publish | -| vsix-path | Y | Path to the local VSIX package you wish to publish | -| vs-version | N | Specify the exact version of Visual Studio tooling to use; default to `latest` | -| vs-prerelease | N | Allow a pre-release installation of Visual Studio tooling; default to `false` | +Made with ❤️ by Coding With Calvin diff --git a/package-lock.json b/package-lock.json index cd9d2fa..872c83e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -100,6 +100,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.2.tgz", "integrity": "sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA==", "dev": true, + "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.24.7", @@ -1655,6 +1656,7 @@ "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2090,6 +2092,7 @@ "url": "https://github.com/sponsors/ai" } ], + "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001663", "electron-to-chromium": "^1.5.28", @@ -2779,6 +2782,7 @@ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "dev": true, + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -2834,6 +2838,7 @@ "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, + "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -4628,6 +4633,7 @@ "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, + "peer": true, "dependencies": { "@jest/core": "^29.7.0", "@jest/types": "^29.6.3", @@ -5881,6 +5887,7 @@ "integrity": "sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -6815,6 +6822,7 @@ "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver"