From 2dbc19e23820f134ead554e9ac73e077de69f035 Mon Sep 17 00:00:00 2001 From: Alex Pinkus Date: Sat, 28 Aug 2021 13:32:04 -0700 Subject: [PATCH] Publish parser source from Github Actions run The downside of not checking in `parser.c` is that you have to do a bunch of setup to get one. This change just uploads the files that we generated when GitHub Actions checked our code, making it accessible to anyone who can read the repository. --- .github/workflows/check.yml | 5 +++++ README.md | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index d0e9100..817c93d 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -29,3 +29,8 @@ jobs: - run: npm install - run: npm run ci - run: npm test + - name: Publish parser source + uses: actions/upload-artifact@v2 + with: + name: generated-parser-src + path: src diff --git a/README.md b/README.md index 66d27ae..dc43867 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,15 @@ This repository currently omits most of the code that is autogenerated during a `grammar.json` and `parser.c` are both only available following a build. It also significantly reduces noise during diffs. -The side benefit of not checking in `parser.c` is that parsers aren't always backwards compatible. If you need a parser, -generate it yourself using the CLI; all the information to do so is available in this package. By doing that, you'll -also know for sure that your parser version and your library version are compatible. +The side benefit of not checking in `parser.c` is that you can guarantee backwards compatibility. Parsers generated by +the tree-sitter CLI aren't always backwards compatible. If you need a parser, generate it yourself using the CLI; all +the information to do so is available in this package. By doing that, you'll also know for sure that your parser version +and your library version are compatible. + +If you need a `parser.c`, and you don't care about the tree-sitter version, but you don't have a local setup that would +allow you to obtain the parser, you can just download one from a recent workflow run in this package. To do so: +* Go to the [GitHub actions page](https://github.com/alex-pinkus/experimental-tree-sitter-swift/actions) for this + repository. +* Click on the appropriate commit. +* Go down to `Artifacts` and click on `generated-parser-src`. All the relevant parser files will be available in your + download.