Support dots in URL path segments (#7) #27
This file contains hidden or 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
| on: | |
| push: | |
| branches: | |
| - main | |
| name: Deploy | |
| jobs: | |
| deploy-packages: | |
| name: Packages | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'yarn' | |
| - run: yarn install --immutable | |
| - run: yarn build | |
| - name: Check if VSCode Extension version is unpublished on Open VSX | |
| id: check-open-vsx | |
| shell: bash | |
| run: | | |
| VERSION=$(node -p "require('./packages/urlspec-vscode-extension/package.json').version") | |
| HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://open-vsx.org/api/daangn/urlspec-vscode-extension/$VERSION") | |
| echo "version=$VERSION" | |
| echo "unpublished=$([ "$HTTP_STATUS" = "404" ] && echo 'true' || echo 'false')" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "unpublished=$([ "$HTTP_STATUS" = "404" ] && echo 'true' || echo 'false')" >> "$GITHUB_OUTPUT" | |
| - name: Create Release Pull Request or Publish to npm | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| publish: yarn changeset:publish | |
| version: yarn changeset:version | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| - name: Publish to Open VSX Registry | |
| if: steps.check-open-vsx.outputs.unpublished == 'true' | |
| shell: bash | |
| env: | |
| OVSX_PAT: ${{ secrets.OPEN_VSX_TOKEN }} | |
| run: | | |
| cd packages/urlspec-vscode-extension | |
| VSIX_FILE=$(ls *.vsix) | |
| npx ovsx publish "$VSIX_FILE" --pat "$OVSX_PAT" |