Workflow file for this run
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
| name: Pre-release - for tags with commit in dev branch | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| workflow_dispatch: | |
| concurrency: | |
| group: pre-release | |
| cancel-in-progress: true | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| proceed: ${{ steps.verify-tag.outputs.proceed }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Ensure we can get latest tag futher below by including tags | |
| # More details at https://github.com/actions/checkout/issues/1471#issuecomment-1755639487 | |
| with: | |
| fetch-depth: 0 | |
| filter: tree:0 | |
| - name: Verify tag is on dev branch | |
| id: verify-tag | |
| run: | | |
| if git merge-base --is-ancestor $(git rev-parse HEAD) origin/dev; then | |
| echo "Tag is on dev branch, proceeding with deployment" | |
| echo "proceed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "Tag is not on dev branch, aborting" | |
| echo "proceed=false" >> $GITHUB_OUTPUT | |
| fi | |
| test: | |
| needs: check | |
| runs-on: ubuntu-latest | |
| if: needs.check.outputs.proceed == 'true' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Run service tests | |
| run: bun run test-services | |
| build: | |
| needs: test | |
| if: needs.check.outputs.proceed == 'true' | |
| strategy: | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| platform: win32 | |
| arch: x64 | |
| npm_config_arch: x64 | |
| - os: ubuntu-latest | |
| platform: linux | |
| arch: x64 | |
| npm_config_arch: x64 | |
| - os: ubuntu-latest | |
| platform: linux | |
| arch: arm64 | |
| npm_config_arch: arm64 | |
| - os: ubuntu-latest | |
| platform: linux | |
| arch: armhf | |
| npm_config_arch: arm | |
| - os: ubuntu-latest | |
| platform: alpine | |
| arch: x64 | |
| npm_config_arch: x64 | |
| - os: macos-latest | |
| platform: darwin | |
| arch: x64 | |
| npm_config_arch: x64 | |
| - os: macos-latest | |
| platform: darwin | |
| arch: arm64 | |
| npm_config_arch: arm64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Install macOS dependencies | |
| if: contains(matrix.os, 'macos') | |
| run: brew install python-setuptools | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install vsce | |
| run: bun install -g @vscode/vsce | |
| - run: bun install --frozen-lockfile | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| npm_config_arch: ${{ matrix.npm_config_arch }} | |
| - shell: pwsh | |
| run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV | |
| - run: bun run compile && vsce package --pre-release --target ${{ env.target }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.target }} | |
| path: '*.vsix' | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: success() && needs.check.outputs.proceed == 'true' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Ensure we can get latest tag futher below by including tags | |
| # More details at https://github.com/actions/checkout/issues/1471#issuecomment-1755639487 | |
| with: | |
| fetch-depth: 0 | |
| filter: tree:0 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install vsce | |
| run: bun install -g @vscode/vsce | |
| - uses: actions/download-artifact@v4 | |
| - name: Create GitHub Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| LATEST_TAG=$(git describe --tags --abbrev=0) || { echo "No existing tags found. Please create a tag first."; exit 1; } | |
| gh release create $LATEST_TAG --generate-notes | |
| for file in **/*.vsix; do | |
| gh release upload $LATEST_TAG "$file" | |
| done | |
| - run: bunx vsce publish --pre-release --packagePath $(find . -iname *.vsix) | |
| env: | |
| VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
| - name: Install ovsx | |
| run: bun install -g ovsx | |
| - name: Publish to OpenVSX Registry | |
| run: | | |
| for file in **/*.vsix; do | |
| bunx ovsx publish "$file" -p ${{ secrets.OPEN_VSX_DEVDB_TOKEN }} | |
| done |