### Platform Extraction Logic (Python) Source: https://context7.com/sublimelsp/repository/llms.txt Illustrates how the auto-update script extracts platform identifiers from release asset filenames. It defines valid platform patterns and provides examples for mapping filenames to platform specifications, including a wildcard for all platforms. ```python # Valid platform identifiers in asset names: # - windows, windows-x64, windows-x32 # - osx, osx-x64 # - linux, linux-x32, linux-x64 # Asset naming convention: PackageName_platform.zip # Examples: "LSP-clangd_windows-x64.zip" # -> platforms: "windows-x64" "LSP-clangd_linux-x64.zip" # -> platforms: "linux-x64" "LSP-clangd_osx-x64.zip" # -> platforms: "osx-x64" "LSP-pyright.zip" # -> platforms: "*" (all platforms) ``` -------------------------------- ### GitHub Actions Workflow for New Releases (YAML) Source: https://context7.com/sublimelsp/repository/llms.txt An example GitHub Actions workflow configuration (`on-new-release.yml`) that triggers on repository dispatch events. This workflow automates the creation of pull requests when new LSP package versions are released, ensuring the repository stays up-to-date. ```yaml on: repository_dispatch: types: [new-release] jobs: create_pr: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 - name: Run auto-update script id: update_script run: | python3 auto-update-repository.py < $GITHUB_EVENT_PATH env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create Pull Request uses: peter-evans/create-pull-request@v4 with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: "${{ steps.update_script.outputs.commit_message }}" title: "${{ steps.update_script.outputs.pr_title }}" body: "${{ steps.update_script.outputs.pr_body }}" branch: "auto-update-repository" delete-branch: true ``` -------------------------------- ### Adding a New LSP Package Definition (JSON) Source: https://context7.com/sublimelsp/repository/llms.txt Illustrates how to add a new LSP package definition to the `repository.json` file. It shows the basic required fields and optional fields that can be included for more detailed package information. Submissions are typically made via pull requests. ```json // Add to the "packages" array in repository.json (alphabetically sorted): { "details": "https://github.com/username/LSP-mylanguage", "name": "LSP-mylanguage", "labels": ["lsp", "mylanguage"], "releases": [ { "sublime_text": ">=4070", "tags": true } ] } ``` ```json // Optional fields: { "details": "https://github.com/username/LSP-mylanguage", "name": "LSP-mylanguage", "author": "username", "homepage": "https://mylanguage.org", "issues": "https://github.com/username/LSP-mylanguage/issues", "previous_names": ["LSP-old-name"], "labels": ["lsp", "mylanguage"], "releases": [ { "sublime_text": ">=4070", "tags": true } ] } ``` -------------------------------- ### Sublime Text Version Range Specification (Markdown) Source: https://context7.com/sublimelsp/repository/llms.txt Details the format for specifying Sublime Text version compatibility within GitHub release bodies. This allows precise control over which Sublime Text builds a package will support, using various range notations. ```markdown # In GitHub release body: Sublime-Text-Version-Range: >=4070 This release includes support for the new LSP features. # Version range formats: ">=3154" # Sublime Text 3154 and newer "3154 - 3999" # Sublime Text 3 only (build 3154 to 3999) ">=4000" # Sublime Text 4 and newer ">=4070" # Sublime Text 4 build 4070 and newer ">=4148" # Sublime Text 4 build 4148 and newer ``` -------------------------------- ### Trigger Workflow via GitHub API Source: https://context7.com/sublimelsp/repository/llms.txt This snippet demonstrates how to trigger a GitHub Actions workflow using the GitHub API. It sends a POST request to the repository dispatches endpoint with event type and client payload details. This is useful for automating package updates or other CI/CD tasks. ```bash curl -X POST \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token $GITHUB_TOKEN" \ https://api.github.com/repos/sublimelsp/lsp-packages/dispatches \ -d '{ "event_type": "lsp-add-or-update-package", "client_payload": { "release": { "tag_name": "1.0.0", "published_at": "2024-01-15T10:00:00Z", "body": "Initial release", "assets": [] }, "repository": { "name": "LSP-newlang", "html_url": "https://github.com/sublimelsp/LSP-newlang" } } }' ``` -------------------------------- ### Package Entry Structure (JSON) Source: https://context7.com/sublimelsp/repository/llms.txt Defines the structure for a package entry in the repository. It includes details like the GitHub repository URL, package name, discoverability labels, and release configurations. This structure is used for both simple tag-based and binary releases. ```json { "details": "https://github.com/sublimelsp/LSP-pyright", "name": "LSP-pyright", "labels": ["lsp", "python"], "releases": [ { "sublime_text": "3154 - 4147", "tags": "st3-" }, { "sublime_text": ">=4148", "tags": true } ] } ``` ```json // For packages with binary releases: { "details": "https://github.com/sublimelsp/LSP-clangd", "name": "LSP-clangd", "labels": ["lsp", "c++"], "releases": [ { "url": "https://github.com/.../LSP-clangd_windows-x64.zip", "platforms": "windows-x64", "date": "2024-01-15 14:30:00", "version": "1.2.0", "sublime_text": ">=4070" } ] } ``` -------------------------------- ### Auto-Update Repository Script (Python) Source: https://context7.com/sublimelsp/repository/llms.txt A Python script that processes GitHub release event JSON data from standard input. It extracts release and platform information to generate Package Control repository entries and update the `repository.json` file. The script also outputs commit and PR details for workflow automation. ```python # Example GitHub release event payload (input via stdin) { "release": { "tag_name": "1.2.0", "published_at": "2024-01-15T14:30:00Z", "body": "Sublime-Text-Version-Range: >=4070\n\nBug fixes and improvements", "assets": [ { "name": "LSP-example_windows-x64.zip", "content_type": "application/zip", "browser_download_url": "https://github.com/sublimelsp/LSP-example/releases/download/1.2.0/LSP-example_windows-x64.zip" }, { "name": "LSP-example_linux-x64.zip", "content_type": "application/zip", "browser_download_url": "https://github.com/sublimelsp/LSP-example/releases/download/1.2.0/LSP-example_linux-x64.zip" }, { "name": "LSP-example_osx-x64.zip", "content_type": "application/zip", "browser_download_url": "https://github.com/sublimelsp/LSP-example/releases/download/1.2.0/LSP-example_osx-x64.zip" } ] }, "repository": { "name": "LSP-example", "html_url": "https://github.com/sublimelsp/LSP-example" } } # Run the script with: # python3 auto-update-repository.py < release_event.json # Output: Modified repository.json and GitHub workflow outputs: # ::set-output name=commit_message::Add LSP-example # ::set-output name=pr_title::Add LSP-example # ::set-output name=pr_body::## Repo link... ``` -------------------------------- ### Package Control Repository JSON Schema Source: https://context7.com/sublimelsp/repository/llms.txt Defines the structure for the Package Control repository, including package dependencies, release information, platform compatibility, and Sublime Text version requirements. This schema is used to register LSP helper packages. ```json { "schema_version": "3.0.0", "dependencies": [ { "author": "rchl", "description": "Module with LSP-related utilities", "name": "lsp_utils", "load_order": "10", "releases": [ { "base": "https://github.com/sublimelsp/lsp_utils", "sublime_text": ">=4132", "tags": "st4legacy-v" } ] } ], "packages": [ { "details": "https://github.com/sublimelsp/LSP-typescript", "name": "LSP-typescript", "labels": ["lsp", "javascript", "typescript"], "releases": [ { "sublime_text": "3154 - 3999", "tags": "st3-" }, { "sublime_text": ">=4000", "tags": true } ] } ] } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.