🚀 Release packages #14
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: 🚀 Release packages | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: 'Branch to release' | |
| required: true | |
| default: 'main' | |
| npm_tag: | |
| type: choice | |
| description: 'Specify npm tag' | |
| required: true | |
| default: 'alpha' | |
| options: | |
| - alpha | |
| - beta | |
| - rc | |
| - canary | |
| - latest | |
| extension_type: | |
| type: choice | |
| description: 'Specify the release type of extension' | |
| required: true | |
| default: pre-release | |
| options: | |
| - official | |
| - pre-release | |
| to_release: | |
| description: 'Packages to release' | |
| type: choice | |
| required: true | |
| options: | |
| - all | |
| - npm | |
| - extension | |
| env: | |
| GO_VERSION: '1.24.1' | |
| jobs: | |
| pre-check: | |
| name: Test | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| ref: ${{ github.event.inputs.branch }} | |
| submodules: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Install pnpm | |
| run: corepack enable | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Download Artifact | |
| uses: actions/download-artifact@v4.1.7 | |
| with: | |
| path: binaries | |
| - name: Move binaries | |
| run: | | |
| for file in binaries/*; do | |
| filename=$(basename "$file") | |
| dirname="${filename%-rslint}" | |
| target_dir="npm/$dirname" | |
| mkdir -p "$target_dir" | |
| mv "$file" "npm/$dirname/rslint" | |
| echo "Moved $file to $target_dir/rslint" | |
| done | |
| - name: Format code | |
| run: pnpm format:check | |
| - name: Build Rule Tester | |
| run: pnpm build:rule-tester | |
| - name: TypeCheck | |
| run: pnpm --filter @typescript-eslint/rule-tester run build | |
| - name: Lint code | |
| run: pnpm lint | |
| - name: Test on Linux | |
| run: xvfb-run -a pnpm -r test | |
| publish: | |
| name: Publish | |
| needs: [build, pre-check] | |
| env: | |
| release_npm: ${{ inputs.to_release == 'all' || inputs.to_release == 'npm' }} | |
| release_extension: ${{ inputs.to_release == 'all' || inputs.to_release == 'extension' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| ref: ${{ github.event.inputs.branch }} | |
| submodules: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Install pnpm | |
| run: corepack enable | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Format code | |
| run: pnpm format:check | |
| - name: Publish npm packages | |
| if: env.release_npm == 'true' | |
| env: | |
| NPM_TOKEN: ${{ secrets.RSLINT_NPM_TOKEN }} | |
| run: | | |
| npm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}" | |
| pnpm -r publish --dry-run --tag ${{ github.event.inputs.npm_tag }} --publish-branch ${{ github.event.inputs.branch }} | |
| - name: Build and publish to Microsoft VS Code Marketplace | |
| if: false | |
| env: | |
| VSCE_PAT: ${{ secrets.RSLINT_VSCE_PAT }} | |
| run: | | |
| if [ "${{ github.event.inputs.extension_type }}" = "pre-release" ]; then | |
| pnpm publish:vsce --prerelease | |
| else | |
| pnpm publish:vsce | |
| fi | |
| - name: Build and publish to Open VSX Registry | |
| if: false | |
| env: | |
| OVSX_PAT: ${{ secrets.RSLINT_OVSX_PAT }} | |
| run: | | |
| if [ "${{ github.event.inputs.extension_type }}" = "pre-release" ]; then | |
| pnpm publish:ovsx --prerelease | |
| else | |
| pnpm publish:ovsx | |
| fi | |
| build: | |
| name: Build-Rslint-Binaries | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - goos: darwin | |
| goarch: amd64 | |
| node_arch: x64 | |
| node_os: darwin | |
| - goos: darwin | |
| goarch: arm64 | |
| node_arch: arm64 | |
| node_os: darwin | |
| - goos: linux | |
| goarch: amd64 | |
| node_arch: x64 | |
| node_os: linux | |
| - goos: linux | |
| goarch: arm64 | |
| node_arch: arm64 | |
| node_os: linux | |
| # - goos: windows | |
| # goarch: amd64 | |
| # node_arch: x64 | |
| # node_os: win32 | |
| # - goos: windows | |
| # goarch: arm64 | |
| # node_arch: arm64 | |
| # node_os: win32 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| ref: ${{ github.event.inputs.branch }} | |
| submodules: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Install pnpm | |
| run: corepack enable | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Go Build packages | |
| run: | | |
| GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o ${{ matrix.node_os }}-${{ matrix.node_arch }}-rslint ./cmd/rslint | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.node_os }}-${{ matrix.node_arch }}-rslint | |
| path: ${{ matrix.node_os }}-${{ matrix.node_arch }}-rslint |