From 98be227227af10cc7a269cb3ffb23686c0610b17 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Thu, 25 Jan 2024 14:39:11 -0500 Subject: [PATCH] 0.20.9 --- .github/workflows/publish.yml | 79 +++++++++++++++++++++++++++++++---- Cargo.lock | 2 +- cli/Cargo.toml | 2 +- cli/npm/package.json | 2 +- lib/binding_web/package.json | 2 +- 5 files changed, 76 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e1ad3e05..e91d6975 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,17 +5,82 @@ on: jobs: crates_io: - name: Publish to Crates.io + name: Publish CLI to Crates.io runs-on: ubuntu-latest steps: - - name: Publish packages + - name: Get latest tag + id: latest_tag run: | - echo "::warning::TODO: add a Crates.io publish logic" + echo "tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT - npm: - name: Publish to npmjs.com + - name: Check out latest tag + uses: actions/checkout@v4 + with: + ref: ${{ steps.latest_tag.outputs.tag }} + + - name: Setup Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Publish CLI to Crates.io + uses: katyo/publish-crates@v2 + with: + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} + + npm_cli: + name: Publish CLI to npmjs.com runs-on: ubuntu-latest steps: - - name: Publish packages + - name: Get latest tag + id: latest_tag run: | - echo "::warning::TODO: add a npmjs.com publish logic" + echo "tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT + + - name: Check out latest tag + uses: actions/checkout@v4 + with: + ref: ${{ steps.latest_tag.outputs.tag }} + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 18 + registry-url: "https://registry.npmjs.org" + + - name: Publish CLI to npmjs.com + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + run: | + cd cli/npm + npm publish + + + npm_lib: + name: Publish lib to npmjs.com + runs-on: ubuntu-latest + steps: + - name: Get latest tag + id: latest_tag + run: | + echo "tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT + + - name: Check out latest tag + uses: actions/checkout@v4 + with: + ref: ${{ steps.latest_tag.outputs.tag }} + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 18 + registry-url: "https://registry.npmjs.org" + + - name: Publish lib to npmjs.com + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + run: | + cd lib/binding_web + npm publish diff --git a/Cargo.lock b/Cargo.lock index 28f169c0..bbd2be01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1235,7 +1235,7 @@ dependencies = [ [[package]] name = "tree-sitter-cli" -version = "0.20.8" +version = "0.20.9" dependencies = [ "ansi_term", "anyhow", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 0261fdcc..97c6a129 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tree-sitter-cli" description = "CLI tool for developing, testing, and using Tree-sitter parsers" -version = "0.20.8" +version = "0.20.9" authors = ["Max Brunsfeld "] edition = "2021" license = "MIT" diff --git a/cli/npm/package.json b/cli/npm/package.json index e60c3936..51c7e778 100644 --- a/cli/npm/package.json +++ b/cli/npm/package.json @@ -1,6 +1,6 @@ { "name": "tree-sitter-cli", - "version": "0.20.8", + "version": "0.20.9", "author": "Max Brunsfeld", "license": "MIT", "repository": { diff --git a/lib/binding_web/package.json b/lib/binding_web/package.json index 42fdc518..47429fd2 100644 --- a/lib/binding_web/package.json +++ b/lib/binding_web/package.json @@ -1,6 +1,6 @@ { "name": "web-tree-sitter", - "version": "0.20.8", + "version": "0.20.9", "description": "Tree-sitter bindings for the web", "main": "tree-sitter.js", "types": "tree-sitter-web.d.ts",