|
6 | 6 | pull_request:
|
7 | 7 | branches: [master]
|
8 | 8 | workflow_dispatch:
|
9 |
| - |
| 9 | + inputs: |
| 10 | + publishToMarketPlace: |
| 11 | + description: 'Publish to VS Code Marketplace ?' |
| 12 | + required: true |
| 13 | + type: choice |
| 14 | + options: |
| 15 | + - 'true' |
| 16 | + - 'false' |
| 17 | + default: 'false' |
| 18 | + publishToOVSX: |
| 19 | + description: 'Publish to OpenVSX Registry ?' |
| 20 | + required: true |
| 21 | + type: choice |
| 22 | + options: |
| 23 | + - 'true' |
| 24 | + - 'false' |
| 25 | + default: 'false' |
10 | 26 | jobs:
|
11 | 27 | test:
|
12 | 28 | runs-on: ${{ matrix.os }} # runs a test on Ubuntu, Windows and macOS
|
|
59 | 75 | uses: codecov/codecov-action@v4
|
60 | 76 | with:
|
61 | 77 | file: ./coverage/coverage-final.json
|
62 |
| - |
| 78 | + |
| 79 | + packaging-job: |
| 80 | + runs-on: ubuntu-latest |
| 81 | + if: ${{ github.event_name != 'schedule' }} |
| 82 | + steps: |
| 83 | + - name: Checkout vscode-server-connector |
| 84 | + uses: actions/checkout@v4 |
| 85 | + - name: Set Up NodeJS |
| 86 | + uses: actions/setup-node@v4 |
| 87 | + with: |
| 88 | + node-version: '18' |
| 89 | + - name: Install NodeJS dependencies |
| 90 | + run: npm install -g typescript "@vscode/vsce" "ovsx" |
| 91 | + - name: Cache Version |
| 92 | + run: | |
| 93 | + echo "EXT_VERSION=$(cat package.json | jq -r .version)" >> $GITHUB_ENV |
| 94 | + - name: Build vscode-server-connector |
| 95 | + run: | |
| 96 | + npm install |
| 97 | + npm run build |
| 98 | + - name: Package vscode-server-connector |
| 99 | + run: | |
| 100 | + vsce package -o vscode-server-connector-${{ env.EXT_VERSION }}.vsix |
| 101 | + ls -lash *.vsix |
| 102 | + - name: Upload VSIX Artifacts |
| 103 | + uses: actions/upload-artifact@v4 |
| 104 | + with: |
| 105 | + name: vscode-server-connector |
| 106 | + path: | |
| 107 | + vscode-server-connector-${{ env.EXT_VERSION }}.vsix |
| 108 | + if-no-files-found: error |
| 109 | + release-job: |
| 110 | + environment: ${{ (inputs.publishToMarketPlace == 'true' || inputs.publishToOVSX == 'true') && 'release' }} |
| 111 | + runs-on: ubuntu-latest |
| 112 | + needs: packaging-job |
| 113 | + steps: |
| 114 | + - name: Set Up NodeJS |
| 115 | + uses: actions/setup-node@v4 |
| 116 | + with: |
| 117 | + node-version: '18' |
| 118 | + - name: Install dependencies |
| 119 | + run: | |
| 120 | + npm install -g typescript "@vscode/vsce" "ovsx" |
| 121 | + - name: Download VSIX |
| 122 | + uses: actions/download-artifact@v4 |
| 123 | + - name: Publish to VS Code Marketplace |
| 124 | + if: ${{ inputs.publishToMarketPlace == 'true' }} |
| 125 | + run: | |
| 126 | + ls -la #debug |
| 127 | + for platformVsix in vscode-server-connector/*.vsix; do |
| 128 | + echo "Running command: vsce publish --skip-duplicate -p SOME_SECRET --packagePath ${platformVsix}" |
| 129 | + vsce publish --skip-duplicate -p ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} --packagePath ${platformVsix} |
| 130 | + done |
| 131 | + - name: Publish to OpenVSX Registry |
| 132 | + if: ${{ inputs.publishToOVSX == 'true' }} |
| 133 | + run: | |
| 134 | + ls -la #debug |
| 135 | + for platformVsix in vscode-server-connector/*.vsix; do |
| 136 | + echo "Running command: ovsx publish --skip-duplicate -p SOME_SECRET --packagePath ${platformVsix}" |
| 137 | + ovsx publish --skip-duplicate -p ${{ secrets.OVSX_MARKETPLACE_TOKEN }} --packagePath ${platformVsix} |
| 138 | + done |
0 commit comments