Publish extensions to open-vsx.org #1757
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish extensions to open-vsx.org | |
on: | |
schedule: | |
# Run at 03:03 UTC every day. | |
- cron: "3 3 * * 1-5" | |
workflow_dispatch: | |
inputs: | |
extensions: | |
description: "Comma separated list of extensions to publish" | |
required: false | |
default: "" | |
skipPublish: | |
description: "Skip publishing to Open VSX, only build extensions" | |
type: boolean | |
required: false | |
default: false | |
forcefullyPublish: | |
description: "Force publish to Open VSX, even if version is already published" | |
type: boolean | |
required: false | |
default: false | |
jobs: | |
publish_extensions: | |
env: | |
EXTENSIONS: ${{ github.event.inputs.extensions }} | |
SKIP_PUBLISH: ${{ github.event.inputs.skipPublish }} | |
FORCE: ${{ github.event.inputs.forcefullyPublish }} | |
name: Publish Extensions | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4.1.0 | |
with: | |
node-version: "18.x" | |
- uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
- name: Set up pyenv | |
uses: "gabrielfalcao/pyenv-action@2f49ca7587f9d0663d13f1147b78d3361417eaf7" | |
with: | |
command: python --version | |
- name: Set default global version | |
run: | | |
pyenv install 3.8 | |
pyenv global 3.8 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: "microsoft" | |
java-version: "17" | |
- name: Install dependencies for native modules | |
run: | | |
sudo apt-get update | |
sudo apt-get install libpango1.0-dev libgif-dev | |
- run: npm install | |
- run: npm i -g @vscode/vsce | |
- run: node publish-extensions | |
env: | |
OVSX_PAT: ${{ secrets.OVSX_PAT }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Report results | |
run: bun run ./report-extensions.ts | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: report | |
path: | | |
/tmp/stat.json | |
/tmp/result.md | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: artifacts | |
path: | | |
/tmp/artifacts/*.vsix | |
- name: Upload job summary | |
if: always() | |
run: cat /tmp/result.md >> $GITHUB_STEP_SUMMARY | |
- name: Get previous job's status | |
id: lastrun | |
uses: filiptronicek/get-last-job-status@main | |
- name: Slack Notification | |
if: ${{ !github.event.inputs.extensions && ((success() && steps.lastrun.outputs.status == 'failed') || failure()) }} | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.GITPOD_SLACK_WEBHOOK }} | |
SLACK_COLOR: ${{ job.status }} | |
check_parity: | |
name: Check MS parity | |
runs-on: ubuntu-latest | |
needs: publish_extensions | |
if: ${{ !github.event.inputs.extensions }} # only run on full runs | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4.1.0 | |
with: | |
node-version: "18.x" | |
- run: npm install | |
- name: Check parity of the top 4096 extensions | |
run: node lib/reportStat.js |