From 88a698a904caf3370368fb4ff2a22557cc4f4ee1 Mon Sep 17 00:00:00 2001 From: Firas al-Khalil Date: Tue, 5 Nov 2024 14:52:34 +0100 Subject: [PATCH 1/3] ci: auto create merge request for ruby-tree-sitter --- .github/workflows/ruby-tree-sitter-pr.yml | 56 +++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/ruby-tree-sitter-pr.yml diff --git a/.github/workflows/ruby-tree-sitter-pr.yml b/.github/workflows/ruby-tree-sitter-pr.yml new file mode 100644 index 0000000..234e2de --- /dev/null +++ b/.github/workflows/ruby-tree-sitter-pr.yml @@ -0,0 +1,56 @@ +name: Create ruby-tree-sitter Pull Request on Release +on: + push + # release: + # types: [published] + +jobs: + create-pr: + runs-on: ubuntu-latest + steps: + - name: Checkout this repo + uses: actions/checkout@v4 + + - name: Checkout ruby-tree-sitter + uses: actions/checkout@v4 + with: + repository: stackmystack/ruby-tree-sitter + token: ${{ secrets.TREE_SITTER_PAT }} + path: ruby-tree-sitter + + - name: Get previous releases + id: update_versions + run: | + cd ruby-tree-sitter + TREE_SITTER=$(grep 'tree-sitter-version' parsers.toml | sed -E 's/.*"([0-9.]+)".*/\1/') + sed -i "s/^\([[:space:]]*\)TREESITTER_VERSION = '.*'/\1TREESITTER_VERSION = '$TREE_SITTER'/" lib/tree_sitter/version.rb + PARSERS=$(echo "${{ github.event.release.tag_name }}" | sed "s/^v//") + sed -i "s/(TS_PARSER_VERSION := \').*\'/\1$PARSERS\'/" .justfile + cd - + + # Setup git config + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@github.com" + + # Create new branch + BRANCH="update-parsers-to-$PARSERS" + echo "branch=$BRANCH" >> "$GITHUB_OUTPUT" + git checkout -b "$BRANCH" + + # Add and commit changes + git add . + git commit -m "Update from ${{ github.repository }} release ${{ github.event.release.tag_name }}" + git push origin "$BRANCH" + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.TREE_SITTER_PAT }} + path: ruby-tree-sitter + base: master + delete-branch: true + draft: false + branch: ${{ steps.update_versions.outputs.branch }} + title: "Update from ${{ github.repository }} release ${{ github.event.release.tag_name }}" + body: | + This PR was automatically created to update from ${{ github.repository }} release ${{ github.event.release.tag_name }}. From a09e3c798ed64a7721fdb3196ec18ab0b8936ac4 Mon Sep 17 00:00:00 2001 From: Firas al-Khalil Date: Tue, 5 Nov 2024 14:56:48 +0100 Subject: [PATCH 2/3] ci: bump release action version --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 1a66538..f4a8d9d 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -45,7 +45,7 @@ jobs: run: | ./package/zip - name: Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: tag_name: ${{ steps.vars.outputs.sha_short }} name: Release ${{ github.ref }}-${{ steps.vars.outputs.sha_short }} From a853ce349e1ca4714c35b564be73a32b02035990 Mon Sep 17 00:00:00 2001 From: Firas al-Khalil Date: Tue, 5 Nov 2024 14:53:06 +0100 Subject: [PATCH 3/3] tmp: bump ts --- .github/workflows/ruby-tree-sitter-pr.yml | 1 + parsers.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ruby-tree-sitter-pr.yml b/.github/workflows/ruby-tree-sitter-pr.yml index 234e2de..cc37ddf 100644 --- a/.github/workflows/ruby-tree-sitter-pr.yml +++ b/.github/workflows/ruby-tree-sitter-pr.yml @@ -22,6 +22,7 @@ jobs: id: update_versions run: | cd ruby-tree-sitter + ls -lah . TREE_SITTER=$(grep 'tree-sitter-version' parsers.toml | sed -E 's/.*"([0-9.]+)".*/\1/') sed -i "s/^\([[:space:]]*\)TREESITTER_VERSION = '.*'/\1TREESITTER_VERSION = '$TREE_SITTER'/" lib/tree_sitter/version.rb PARSERS=$(echo "${{ github.event.release.tag_name }}" | sed "s/^v//") diff --git a/parsers.toml b/parsers.toml index b175705..70eeba6 100644 --- a/parsers.toml +++ b/parsers.toml @@ -1,4 +1,4 @@ -tree-sitter-version = "0.23.0" +tree-sitter-version = "0.24.1" [parsers] bash = "0.23.0"