From 3f19e01e5073eafb15b7cc244aa61e18481d642c Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Thu, 18 Jan 2024 17:08:40 +0000 Subject: [PATCH 01/10] Create rust.yml --- .github/workflows/rust.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..8ac4038 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,35 @@ +name: Rust + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Check + run: cargo check --verbose + - name: Run tests + run: cargo test --verbose + + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v4 + with: + # this assumes that you have created a personal access token + # (PAT) and configured it as a GitHub action secret named + # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important). + token: ${{ secrets.RELEASE_PLEASE_TOKEN }} + # this is a built-in strategy in release-please, see "Action Inputs" + # for more options + release-type: rust From 4f5f5d106f4db8032f6afaa84aa736d4d8b67661 Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Thu, 18 Jan 2024 17:20:10 +0000 Subject: [PATCH 02/10] ci: Extract release-please workflow Release please is now done in a separate workflow, since this should only run on master. --- .github/workflows/release-please.yml | 24 ++++++++++++++++++++++++ .github/workflows/rust.yml | 13 ------------- 2 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/release-please.yml diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..158c822 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,24 @@ +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +name: release-please + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v4 + with: + # this assumes that you have created a personal access token + # (PAT) and configured it as a GitHub action secret named + # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important). + token: ${{ secrets.RELEASE_PLEASE_TOKEN }} + # this is a built-in strategy in release-please, see "Action Inputs" + # for more options + release-type: rust diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8ac4038..849f116 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -20,16 +20,3 @@ jobs: run: cargo check --verbose - name: Run tests run: cargo test --verbose - - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v4 - with: - # this assumes that you have created a personal access token - # (PAT) and configured it as a GitHub action secret named - # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important). - token: ${{ secrets.RELEASE_PLEASE_TOKEN }} - # this is a built-in strategy in release-please, see "Action Inputs" - # for more options - release-type: rust From bdfd2fa9f12f244c91b1cdc9cd2d55b23a1cb3cd Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Thu, 18 Jan 2024 17:21:34 +0000 Subject: [PATCH 03/10] ci: Correct branch name in release please workflow This did use main, but our main branch is called master. --- .github/workflows/release-please.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 158c822..5f202bb 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -1,7 +1,7 @@ on: push: branches: - - main + - master permissions: contents: write From bdf4d084ea77cd0332bc1d55579447d01be860d5 Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Thu, 18 Jan 2024 17:34:18 +0000 Subject: [PATCH 04/10] build: Update dependencies This updates all cargo dependencies to their latest version --- Cargo.lock | 119 +++++++++++++++++++++++++++++------------------------ 1 file changed, 65 insertions(+), 54 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 32fe47d..72a5837 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,7 +35,7 @@ dependencies = [ [[package]] name = "allocative" version = "0.3.1" -source = "git+https://github.com/facebookexperimental/starlark-rust.git#b53ade7a37e26f76569fdacd95f298cf27406082" +source = "git+https://github.com/facebookexperimental/starlark-rust.git#9d3444a588f9f93c11975741d73ef6ef907d4dcf" dependencies = [ "allocative_derive", "bumpalo", @@ -47,11 +47,11 @@ dependencies = [ [[package]] name = "allocative_derive" version = "0.3.1" -source = "git+https://github.com/facebookexperimental/starlark-rust.git#b53ade7a37e26f76569fdacd95f298cf27406082" +source = "git+https://github.com/facebookexperimental/starlark-rust.git#9d3444a588f9f93c11975741d73ef6ef907d4dcf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.48", ] [[package]] @@ -126,9 +126,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bumpalo" @@ -136,6 +136,12 @@ version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + [[package]] name = "cfg-if" version = "1.0.0" @@ -156,7 +162,7 @@ dependencies = [ [[package]] name = "cmp_any" version = "0.8.1" -source = "git+https://github.com/facebookexperimental/starlark-rust.git#b53ade7a37e26f76569fdacd95f298cf27406082" +source = "git+https://github.com/facebookexperimental/starlark-rust.git#9d3444a588f9f93c11975741d73ef6ef907d4dcf" [[package]] name = "convert_case" @@ -166,22 +172,18 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "crossbeam-channel" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crunchy" @@ -264,7 +266,7 @@ dependencies = [ [[package]] name = "display_container" version = "0.9.0" -source = "git+https://github.com/facebookexperimental/starlark-rust.git#b53ade7a37e26f76569fdacd95f298cf27406082" +source = "git+https://github.com/facebookexperimental/starlark-rust.git#9d3444a588f9f93c11975741d73ef6ef907d4dcf" dependencies = [ "either", "indenter", @@ -273,7 +275,7 @@ dependencies = [ [[package]] name = "dupe" version = "0.9.0" -source = "git+https://github.com/facebookexperimental/starlark-rust.git#b53ade7a37e26f76569fdacd95f298cf27406082" +source = "git+https://github.com/facebookexperimental/starlark-rust.git#9d3444a588f9f93c11975741d73ef6ef907d4dcf" dependencies = [ "dupe_derive", ] @@ -281,11 +283,11 @@ dependencies = [ [[package]] name = "dupe_derive" version = "0.9.0" -source = "git+https://github.com/facebookexperimental/starlark-rust.git#b53ade7a37e26f76569fdacd95f298cf27406082" +source = "git+https://github.com/facebookexperimental/starlark-rust.git#9d3444a588f9f93c11975741d73ef6ef907d4dcf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.48", ] [[package]] @@ -376,11 +378,20 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -404,9 +415,9 @@ checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "idna" @@ -514,9 +525,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.151" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libredox" @@ -524,16 +535,16 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "libc", "redox_syscall", ] [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" @@ -744,9 +755,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "proc-macro2" -version = "1.0.74" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2de98502f212cfcea8d0bb305bd0f49d7ebdd75b64ba0a68f937d888f4e0d6db" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] @@ -836,11 +847,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", @@ -938,29 +949,29 @@ checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" [[package]] name = "serde" -version = "1.0.194" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b114498256798c94a0689e1a15fec6005dee8ac1f41de56404b67afc2a4b773" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.194" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3385e45322e8f9931410f01b3031ec534c3947d0e94c18049af4d9f9907d4e0" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.110" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fbd975230bada99c8bb618e0c365c2eefa219158d5c6c29610fd09ff1833257" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", @@ -975,7 +986,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.48", ] [[package]] @@ -986,14 +997,14 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "smallvec" -version = "1.11.2" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "2593d31f82ead8df961d8bd23a64c2ccf2eb5dd34b0a34bfb4dd54011c72009e" [[package]] name = "starlark" version = "0.10.0" -source = "git+https://github.com/facebookexperimental/starlark-rust.git#b53ade7a37e26f76569fdacd95f298cf27406082" +source = "git+https://github.com/facebookexperimental/starlark-rust.git#9d3444a588f9f93c11975741d73ef6ef907d4dcf" dependencies = [ "allocative", "anyhow", @@ -1031,18 +1042,18 @@ dependencies = [ [[package]] name = "starlark_derive" version = "0.10.0" -source = "git+https://github.com/facebookexperimental/starlark-rust.git#b53ade7a37e26f76569fdacd95f298cf27406082" +source = "git+https://github.com/facebookexperimental/starlark-rust.git#9d3444a588f9f93c11975741d73ef6ef907d4dcf" dependencies = [ "dupe", "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.48", ] [[package]] name = "starlark_lsp" version = "0.10.0" -source = "git+https://github.com/facebookexperimental/starlark-rust.git#b53ade7a37e26f76569fdacd95f298cf27406082" +source = "git+https://github.com/facebookexperimental/starlark-rust.git#9d3444a588f9f93c11975741d73ef6ef907d4dcf" dependencies = [ "anyhow", "derivative", @@ -1061,12 +1072,12 @@ dependencies = [ [[package]] name = "starlark_map" version = "0.10.0" -source = "git+https://github.com/facebookexperimental/starlark-rust.git#b53ade7a37e26f76569fdacd95f298cf27406082" +source = "git+https://github.com/facebookexperimental/starlark-rust.git#9d3444a588f9f93c11975741d73ef6ef907d4dcf" dependencies = [ "allocative", "dupe", "equivalent", - "fnv", + "fxhash", "hashbrown 0.12.3", "serde", ] @@ -1074,7 +1085,7 @@ dependencies = [ [[package]] name = "starlark_syntax" version = "0.10.0" -source = "git+https://github.com/facebookexperimental/starlark-rust.git#b53ade7a37e26f76569fdacd95f298cf27406082" +source = "git+https://github.com/facebookexperimental/starlark-rust.git#9d3444a588f9f93c11975741d73ef6ef907d4dcf" dependencies = [ "allocative", "annotate-snippets", @@ -1138,9 +1149,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.46" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89456b690ff72fddcecf231caedbe615c59480c93358a93dfae7fc29e3ebbf0e" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -1184,7 +1195,7 @@ checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.48", ] [[package]] @@ -1213,9 +1224,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" From 31d82678082f7ed358929cbc566c9a1c452b3b0b Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Thu, 18 Jan 2024 17:53:39 +0000 Subject: [PATCH 05/10] ci: Upload build artifact This uploads a build artifact after release please has done a release --- .github/workflows/release-please.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 5f202bb..83b2d18 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -14,11 +14,20 @@ jobs: runs-on: ubuntu-latest steps: - uses: google-github-actions/release-please-action@v4 + id: release with: - # this assumes that you have created a personal access token - # (PAT) and configured it as a GitHub action secret named - # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important). token: ${{ secrets.RELEASE_PLEASE_TOKEN }} - # this is a built-in strategy in release-please, see "Action Inputs" - # for more options release-type: rust + - uses: actions/checkout@v3 + if: ${{ steps.release.outputs.release_created }} + - name: Build + if: ${{ steps.release.outputs.release_created }} + run: | + cargo build --release + mkdir -p releases + cp target/release/bazel-lsp releases/bazel-lsp-${{ steps.release.outputs.major }}-${{ steps.release.outputs.minor }}-${{ steps.release.outputs.patch }}-linux-amd64 + - name: Upload Release Artifacts + if: ${{ steps.release.outputs.release_created }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release upload ${{ steps.release.outputs.tag_name }} ./releases/* From b335046f10f8ece1f240e87ca0341cd5d81e0ac5 Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Thu, 18 Jan 2024 17:55:34 +0000 Subject: [PATCH 06/10] fix: Test fix This is a fix to test the release please workflow. This also updates the docs with new installation instructions. --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 1572e05..1c682f0 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,7 @@ This is a LSP for bazel, based off [starlark-rust](https://github.com/facebookex ## Usage -Install the LSP using cargo: - -```sh -cargo install bazel-lsp -``` +Download a release from github releases and add it to your PATH. ### VSCode From 620c33ad2aeed5f4c3451e6d49d6874facf867fa Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Thu, 18 Jan 2024 17:59:30 +0000 Subject: [PATCH 07/10] chore(master): release 0.1.1 (#2) --- CHANGELOG.md | 8 ++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f11815d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## [0.1.1](https://github.com/cameron-martin/bazel-lsp/compare/v0.1.0...v0.1.1) (2024-01-18) + + +### Bug Fixes + +* Test fix ([b335046](https://github.com/cameron-martin/bazel-lsp/commit/b335046f10f8ece1f240e87ca0341cd5d81e0ac5)) diff --git a/Cargo.lock b/Cargo.lock index 72a5837..8965a19 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -86,7 +86,7 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "bazel-lsp" -version = "0.1.0" +version = "0.1.1" dependencies = [ "anyhow", "either", diff --git a/Cargo.toml b/Cargo.toml index 8416e27..dedd250 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bazel-lsp" -version = "0.1.0" +version = "0.1.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 6d2a80ce71187736fe539ff8b4d20c4dbd7f3ac2 Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Thu, 18 Jan 2024 18:06:13 +0000 Subject: [PATCH 08/10] ci: Format version number in release correctly --- .github/workflows/release-please.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 83b2d18..45e55fc 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -25,7 +25,7 @@ jobs: run: | cargo build --release mkdir -p releases - cp target/release/bazel-lsp releases/bazel-lsp-${{ steps.release.outputs.major }}-${{ steps.release.outputs.minor }}-${{ steps.release.outputs.patch }}-linux-amd64 + cp target/release/bazel-lsp releases/bazel-lsp-${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}-linux-amd64 - name: Upload Release Artifacts if: ${{ steps.release.outputs.release_created }} env: From 18a48cd6e0559418b96d117ed31d9e3aee8b681a Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Thu, 18 Jan 2024 18:32:32 +0000 Subject: [PATCH 09/10] docs: Update installation instructions --- .github/workflows/release-please.yml | 8 ++++++-- README.md | 12 ++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 45e55fc..ff15bbf 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -23,9 +23,13 @@ jobs: - name: Build if: ${{ steps.release.outputs.release_created }} run: | - cargo build --release + VERSION=${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} mkdir -p releases - cp target/release/bazel-lsp releases/bazel-lsp-${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}-linux-amd64 + + TARGET=x86_64-unknown-linux-gnu + rustup target add $TARGET + cargo build --release --target $TARGET + cp target/$TARGET/release/bazel-lsp releases/bazel-lsp-$VERSION-linux-amd64 - name: Upload Release Artifacts if: ${{ steps.release.outputs.release_created }} env: diff --git a/README.md b/README.md index 1c682f0..ea71e6b 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,18 @@ # Bazel LSP -This is a LSP for bazel, based off [starlark-rust](https://github.com/facebookexperimental/starlark-rust). +This is a LSP for bazel, forked from [starlark-rust](https://github.com/facebookexperimental/starlark-rust). ## Usage -Download a release from github releases and add it to your PATH. +### Installation + +Download a release from github releases and move it to somewhere on your `$PATH`. + +Alternatively, it can be installed from source by cloning this repo and running the following: + +```sh +cargo install --path . +``` ### VSCode From 231afab7e538c99d4d22e817c863447e5abffdb9 Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Sat, 20 Jan 2024 00:22:14 +0000 Subject: [PATCH 10/10] refactor: Move label module from bazel directory This was historical, from when it was in the starlark-rust repo. --- src/bazel.rs | 4 +--- src/{bazel => }/label.rs | 4 ++-- src/main.rs | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) rename src/{bazel => }/label.rs (99%) diff --git a/src/bazel.rs b/src/bazel.rs index 5c1e040..57f79b3 100644 --- a/src/bazel.rs +++ b/src/bazel.rs @@ -23,8 +23,6 @@ //! interface develops. After the API of the `LspContext` trait stabilizes, this //! module will be removed, and extracted to its own project. -mod label; - use std::borrow::Cow; use std::collections::HashMap; use std::collections::HashSet; @@ -58,12 +56,12 @@ use starlark_lsp::server::LspEvalResult; use starlark_lsp::server::LspUrl; use starlark_lsp::server::StringLiteralResult; -use self::label::Label; use crate::client::BazelClient; use crate::eval::dialect; use crate::eval::globals; use crate::eval::ContextMode; use crate::eval::EvalResult; +use crate::label::Label; #[derive(Debug, thiserror::Error)] enum ContextError { diff --git a/src/bazel/label.rs b/src/label.rs similarity index 99% rename from src/bazel/label.rs rename to src/label.rs index e9fb5a0..3c15cb4 100644 --- a/src/bazel/label.rs +++ b/src/label.rs @@ -117,8 +117,8 @@ impl Label { #[cfg(test)] mod tests { - use super::Label; - use crate::bazel::label::LabelRepo; + use crate::label::Label; + use crate::label::LabelRepo; #[test] fn test_parsing_repo_only_labels() { diff --git a/src/main.rs b/src/main.rs index faee274..e8470d2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ mod bazel; mod client; mod eval; +mod label; #[cfg(test)] pub mod test_fixture;