mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-28 18:10:26 +00:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
331a600f1b | ||
|
|
7fac9c0890 | ||
|
|
b6880389f3 | ||
|
|
a03b7590b9 | ||
|
|
956e07555c | ||
|
|
3b0d937160 | ||
|
|
5a7b7e3798 | ||
|
|
c2c0b6efca | ||
|
|
d6b632e36c | ||
|
|
84749680f0 | ||
|
|
e6c7481b70 | ||
|
|
8a2a11266f | ||
|
|
77774d839c | ||
|
|
481510ca72 | ||
|
|
bb478bb090 | ||
|
|
4558bb807b | ||
|
|
315e996a95 |
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
@@ -83,6 +83,8 @@ jobs:
|
||||
- uses: ./
|
||||
with:
|
||||
tool: ${{ steps.tool-list.outputs.tool }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
|
||||
- name: Test bash
|
||||
run: just --version && shfmt --version && protoc --version
|
||||
@@ -151,6 +153,8 @@ jobs:
|
||||
- uses: ./
|
||||
with:
|
||||
tool: ${{ steps.tool-list.outputs.tool }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
manifest:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -161,7 +165,12 @@ jobs:
|
||||
steps:
|
||||
- uses: taiki-e/checkout-action@v1
|
||||
- name: Install Rust
|
||||
run: rustup toolchain add nightly --no-self-update && rustup default nightly
|
||||
run: rustup update stable --no-self-update
|
||||
- name: Generate Cargo.lock
|
||||
run: cargo update
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
cache-all-crates: 'true'
|
||||
- run: tools/manifest.sh
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
41
CHANGELOG.md
41
CHANGELOG.md
@@ -10,6 +10,38 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [2.41.7] - 2024-06-27
|
||||
|
||||
- Update `biome@latest` to 1.8.3.
|
||||
|
||||
## [2.41.6] - 2024-06-27
|
||||
|
||||
- Update `jaq@latest` to 1.5.0.
|
||||
|
||||
- Update `git-cliff@latest` to 2.4.0.
|
||||
|
||||
## [2.41.5] - 2024-06-25
|
||||
|
||||
- Update `protoc@latest` to 3.27.2.
|
||||
|
||||
## [2.41.4] - 2024-06-25
|
||||
|
||||
- Update `zola@latest` to 0.19.1.
|
||||
|
||||
- Update `syft@latest` to 1.8.0.
|
||||
|
||||
## [2.41.3] - 2024-06-24
|
||||
|
||||
- Update `cargo-binstall@latest` to 1.7.3.
|
||||
|
||||
## [2.41.2] - 2024-06-23
|
||||
|
||||
- Update `typos@latest` to 1.22.9.
|
||||
|
||||
## [2.41.1] - 2024-06-22
|
||||
|
||||
- Update `typos@latest` to 1.22.8.
|
||||
|
||||
## [2.41.0] - 2024-06-21
|
||||
|
||||
- Support `knope`. ([#553](https://github.com/taiki-e/install-action/pull/553), thanks @jayvdb)
|
||||
@@ -2376,7 +2408,14 @@ Note: This release is considered a breaking change because installing on version
|
||||
|
||||
Initial release
|
||||
|
||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.41.0...HEAD
|
||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.41.7...HEAD
|
||||
[2.41.7]: https://github.com/taiki-e/install-action/compare/v2.41.6...v2.41.7
|
||||
[2.41.6]: https://github.com/taiki-e/install-action/compare/v2.41.5...v2.41.6
|
||||
[2.41.5]: https://github.com/taiki-e/install-action/compare/v2.41.4...v2.41.5
|
||||
[2.41.4]: https://github.com/taiki-e/install-action/compare/v2.41.3...v2.41.4
|
||||
[2.41.3]: https://github.com/taiki-e/install-action/compare/v2.41.2...v2.41.3
|
||||
[2.41.2]: https://github.com/taiki-e/install-action/compare/v2.41.1...v2.41.2
|
||||
[2.41.1]: https://github.com/taiki-e/install-action/compare/v2.41.0...v2.41.1
|
||||
[2.41.0]: https://github.com/taiki-e/install-action/compare/v2.40.2...v2.41.0
|
||||
[2.40.2]: https://github.com/taiki-e/install-action/compare/v2.40.1...v2.40.2
|
||||
[2.40.1]: https://github.com/taiki-e/install-action/compare/v2.40.0...v2.40.1
|
||||
|
||||
32
manifests/biome.json
generated
32
manifests/biome.json
generated
@@ -36,13 +36,39 @@
|
||||
},
|
||||
"license_markdown": "[Apache-2.0](https://github.com/biomejs/biome/blob/main/LICENSE-APACHE) OR [MIT](https://github.com/biomejs/biome/blob/main/LICENSE-MIT)",
|
||||
"latest": {
|
||||
"version": "1.8.2"
|
||||
"version": "1.8.3"
|
||||
},
|
||||
"1": {
|
||||
"version": "1.8.2"
|
||||
"version": "1.8.3"
|
||||
},
|
||||
"1.8": {
|
||||
"version": "1.8.2"
|
||||
"version": "1.8.3"
|
||||
},
|
||||
"1.8.3": {
|
||||
"x86_64_linux_musl": {
|
||||
"etag": "0x8DC96B6585206DE",
|
||||
"checksum": "f3db16d376d77cdc28f8031d2e2db95f3620c6f1e463e555bb5f3c441b6b96e5"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DC96B65864DD5B",
|
||||
"checksum": "2cc112178363fa0e11d8f26e0d80598eff6ce481a1ee224b8a8ae2b8a5185124"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DC96B6585BE6C4",
|
||||
"checksum": "541f9a1caa226e6fbb872f16009ac554b16e149c10f9096ebe3f08867c9dbf31"
|
||||
},
|
||||
"aarch64_linux_musl": {
|
||||
"etag": "0x8DC96B65838811D",
|
||||
"checksum": "4f9f2a63255b335a80a197b80a0b2d5d00086c29205dfe7b9b6138c010777987"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"etag": "0x8DC96B65804B322",
|
||||
"checksum": "9d707c28ee8e13158d2b9890dd9faf064a4ea6dabde2009a6a8607480ae8c24a"
|
||||
},
|
||||
"aarch64_windows": {
|
||||
"etag": "0x8DC96B65827565F",
|
||||
"checksum": "d888438925f2d5627afb6be11389c0893070c75b7d9b2d10f196fba910dc3b37"
|
||||
}
|
||||
},
|
||||
"1.8.2": {
|
||||
"x86_64_linux_musl": {
|
||||
|
||||
28
manifests/cargo-binstall.json
generated
28
manifests/cargo-binstall.json
generated
@@ -22,32 +22,32 @@
|
||||
},
|
||||
"license_markdown": "[GPL-3.0](https://github.com/cargo-bins/cargo-binstall/blob/HEAD/crates/bin/LICENSE)",
|
||||
"latest": {
|
||||
"version": "1.7.2"
|
||||
"version": "1.7.3"
|
||||
},
|
||||
"1.7.2": {
|
||||
"1.7.3": {
|
||||
"x86_64_linux_musl": {
|
||||
"etag": "0x8DC9117B0D35BB5",
|
||||
"checksum": "08b6969c86471ecd1b9b6fbbd6508014d22dadda29fdd47ffb871d297ac49a8b"
|
||||
"etag": "0x8DC9395574A8C69",
|
||||
"checksum": "1dda17f293757b9f22b0669ca4471db3315ce01252ec6025f5859adbe00a77cf"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DC911760808EC8",
|
||||
"checksum": "7fa85fd3fda3c9e4962f16f8b9400e97ff2773e0481fc63a9cb882fe80115b7f"
|
||||
"etag": "0x8DC9395170D1071",
|
||||
"checksum": "5f899d270f78fd7798b4aa847a28fbb4eb6fddaa7209abb82fc2452ffbd85d2d"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DC9118FAF6A549",
|
||||
"checksum": "ee4da8bfaf25c84f0b67d5fd8e96f1243df4379f8dad64ffe2f82416198b7b35"
|
||||
"etag": "0x8DC9396630C249A",
|
||||
"checksum": "5f68171fdcbc96f7647ca6585ae4a94149a3abf84f9504146991c2d8f834350e"
|
||||
},
|
||||
"aarch64_linux_musl": {
|
||||
"etag": "0x8DC9117827C4F23",
|
||||
"checksum": "4342cfa8dc1033d2942270e8c4f7a63ef6953632ec3dbfacd7bebd4894e2ece8"
|
||||
"etag": "0x8DC93952A779501",
|
||||
"checksum": "52b5bda4920965a56b9936afa9cb5e90d2081799ad23f4a63f79b82baa0d70b8"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"etag": "0x8DC9117A4F64EA0",
|
||||
"checksum": "68157004ca95c2c3d4fae16246751317d2d6be32911cbdb04a06580d0c3aa43e"
|
||||
"etag": "0x8DC93954D97DFC2",
|
||||
"checksum": "ff87036ee1ae98bc953cfda9d30cdd7ab37357e82adbe0108bab09454224f172"
|
||||
},
|
||||
"aarch64_windows": {
|
||||
"etag": "0x8DC9118BFC4D5AC",
|
||||
"checksum": "baf1c6d5729b629015e199e7739a4f76bd40d9c4a90883ecb1d2c33c16240190"
|
||||
"etag": "0x8DC939621E46FDD",
|
||||
"checksum": "66d6252f41233962d00d196935b98974975ae4a62a6b0ca26e98d0b2ddc25fb8"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
33
manifests/git-cliff.json
generated
33
manifests/git-cliff.json
generated
@@ -28,10 +28,39 @@
|
||||
},
|
||||
"license_markdown": "[MIT](https://github.com/orhun/git-cliff/blob/main/LICENSE-MIT) OR [Apache-2.0](https://github.com/orhun/git-cliff/blob/main/LICENSE-APACHE)",
|
||||
"latest": {
|
||||
"version": "2.3.0"
|
||||
"version": "2.4.0"
|
||||
},
|
||||
"2": {
|
||||
"version": "2.3.0"
|
||||
"version": "2.4.0"
|
||||
},
|
||||
"2.4": {
|
||||
"version": "2.4.0"
|
||||
},
|
||||
"2.4.0": {
|
||||
"x86_64_linux_musl": {
|
||||
"etag": "0x8DC95C89990A18C",
|
||||
"checksum": "4c84e437937b3d6796e8305069bda416cc86245deb6f4f4775314e61501e8460"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DC95C8604ACF69",
|
||||
"checksum": "ae0826f29f0d2e4b6c1d85ed763772d19dce24e70c3f5ecfff48e9f8b4d44b96"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DC95C99F4C8069",
|
||||
"checksum": "787d216a589573917c0279cc53c328d1f64ed88b2e9c4a467647527a207698e8"
|
||||
},
|
||||
"aarch64_linux_musl": {
|
||||
"etag": "0x8DC95C89B11E691",
|
||||
"checksum": "2b2b1b175f5fc9198f5033fddf9aabf3ca048aca5c9751eef85d91572d8bbc3c"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"etag": "0x8DC95C86B530214",
|
||||
"checksum": "9674684fc544333f25c04a867316c12d66f9357c12010bdef919feca0ca2e4c7"
|
||||
},
|
||||
"aarch64_windows": {
|
||||
"etag": "0x8DC95C97CB64DA6",
|
||||
"checksum": "51cd00f04e3187a36a6b5ab65d699f329187083b4c2e8849bf5f0e70dd7d3266"
|
||||
}
|
||||
},
|
||||
"2.3": {
|
||||
"version": "2.3.0"
|
||||
|
||||
29
manifests/jaq.json
generated
29
manifests/jaq.json
generated
@@ -19,10 +19,35 @@
|
||||
},
|
||||
"license_markdown": "[MIT](https://github.com/01mf02/jaq/blob/main/LICENSE-MIT)",
|
||||
"latest": {
|
||||
"version": "1.4.0"
|
||||
"version": "1.5.0"
|
||||
},
|
||||
"1": {
|
||||
"version": "1.4.0"
|
||||
"version": "1.5.0"
|
||||
},
|
||||
"1.5": {
|
||||
"version": "1.5.0"
|
||||
},
|
||||
"1.5.0": {
|
||||
"x86_64_linux_musl": {
|
||||
"etag": "0x8DC95C7C0742176",
|
||||
"checksum": "36095f210f014670b50d5d8d447a3978abb6a919227f7f6140e7cb673d7503f0"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DC95C7D06D3AE9",
|
||||
"checksum": "fb15e68e47ad19dfa15dcec1adb41104e9ff7b1a6b2af8325fe21f7a239cdeae"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DC95C80589FC91",
|
||||
"checksum": "b8aad49b6186446f726a90816814201e2d3f8574cd6c399087e507e68f6f708b"
|
||||
},
|
||||
"aarch64_linux_gnu": {
|
||||
"etag": "0x8DC95C7C4D0BF9A",
|
||||
"checksum": "a04f2cd1be227acc596dda7015da53f57b012951cf8234a230641ca7f700b602"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"etag": "0x8DC95C7D5667A65",
|
||||
"checksum": "963b0261155f9d78b04d30372f2bb772623fc5402057c767c002211f9a744958"
|
||||
}
|
||||
},
|
||||
"1.4": {
|
||||
"version": "1.4.0"
|
||||
|
||||
33
manifests/protoc.json
generated
33
manifests/protoc.json
generated
@@ -3,13 +3,40 @@
|
||||
"template": null,
|
||||
"license_markdown": "[BSD-3-Clause](https://github.com/protocolbuffers/protobuf/blob/HEAD/LICENSE)",
|
||||
"latest": {
|
||||
"version": "3.27.1"
|
||||
"version": "3.27.2"
|
||||
},
|
||||
"3": {
|
||||
"version": "3.27.1"
|
||||
"version": "3.27.2"
|
||||
},
|
||||
"3.27": {
|
||||
"version": "3.27.1"
|
||||
"version": "3.27.2"
|
||||
},
|
||||
"3.27.2": {
|
||||
"x86_64_linux_gnu": {
|
||||
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v27.2/protoc-27.2-linux-x86_64.zip",
|
||||
"etag": "0x8DC9550B6231BCD",
|
||||
"checksum": "4a95e0ea2e51720af86a92f48d4997c8756923a9d0c58fd8a850657cd7479caf"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v27.2/protoc-27.2-osx-x86_64.zip",
|
||||
"etag": "0x8DC9550B67D0B8E",
|
||||
"checksum": "abc25a236571612d45eb4b6b6e6abe3ac9aecc34b195f76f248786844f5619c7"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v27.2/protoc-27.2-win64.zip",
|
||||
"etag": "0x8DC9550B68E8419",
|
||||
"checksum": "a1ea403f845ff4819163ac9da01b14d1d88056231f185f3d83fa7efe542e31f7"
|
||||
},
|
||||
"aarch64_linux_gnu": {
|
||||
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v27.2/protoc-27.2-linux-aarch_64.zip",
|
||||
"etag": "0x8DC9550B5DB4011",
|
||||
"checksum": "ff4760bd4ae510d533e528cc6deb8e32e53f383f0ec01b0327233b4c2e8db314"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v27.2/protoc-27.2-osx-aarch_64.zip",
|
||||
"etag": "0x8DC9550B65A4164",
|
||||
"checksum": "877de17b5d2662b96e68a6e208cb1851437ab3e2b419c2ef5b7b873ffac5357d"
|
||||
}
|
||||
},
|
||||
"3.27.1": {
|
||||
"x86_64_linux_gnu": {
|
||||
|
||||
29
manifests/syft.json
generated
29
manifests/syft.json
generated
@@ -24,10 +24,35 @@
|
||||
},
|
||||
"license_markdown": "[Apache-2.0](https://github.com/anchore/syft/blob/main/LICENSE)",
|
||||
"latest": {
|
||||
"version": "1.7.0"
|
||||
"version": "1.8.0"
|
||||
},
|
||||
"1": {
|
||||
"version": "1.7.0"
|
||||
"version": "1.8.0"
|
||||
},
|
||||
"1.8": {
|
||||
"version": "1.8.0"
|
||||
},
|
||||
"1.8.0": {
|
||||
"x86_64_linux_musl": {
|
||||
"etag": "0x8DC94658785D869",
|
||||
"checksum": "b487ee715e715e960f0d327b49ed9f5926b82bfa2f7283942f9631c41e7c0545"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DC946588776645",
|
||||
"checksum": "4ef1e2949ff85af2558d3e0ea94f78cc284a667ad790446460d7970757ebb353"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DC94658880D18F",
|
||||
"checksum": "984d41fc0d2a9c4b1e4f76a7fa0eb786dc35568e19b3cbea2e355644a9c693c6"
|
||||
},
|
||||
"aarch64_linux_musl": {
|
||||
"etag": "0x8DC9465876AA6CF",
|
||||
"checksum": "df764e35f3d6def7bafd87a9f4a0526c226ae70ec2d7262f6484840c35977f03"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"etag": "0x8DC9465884D5141",
|
||||
"checksum": "4bd5c905c8b751492ed95d486663b92757249a5f25526cbf480fd2b42fadf055"
|
||||
}
|
||||
},
|
||||
"1.7": {
|
||||
"version": "1.7.0"
|
||||
|
||||
42
manifests/typos.json
generated
42
manifests/typos.json
generated
@@ -16,13 +16,49 @@
|
||||
},
|
||||
"license_markdown": "[MIT](https://github.com/crate-ci/typos/blob/master/LICENSE-MIT) OR [Apache-2.0](https://github.com/crate-ci/typos/blob/master/LICENSE-APACHE)",
|
||||
"latest": {
|
||||
"version": "1.22.7"
|
||||
"version": "1.22.9"
|
||||
},
|
||||
"1": {
|
||||
"version": "1.22.7"
|
||||
"version": "1.22.9"
|
||||
},
|
||||
"1.22": {
|
||||
"version": "1.22.7"
|
||||
"version": "1.22.9"
|
||||
},
|
||||
"1.22.9": {
|
||||
"x86_64_linux_musl": {
|
||||
"etag": "0x8DC92DF1EA8F56F",
|
||||
"checksum": "01e336ec8fa9b15a35ecb899e7175bb69956272840e28daeeeea3d56de73f39a"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DC92DF2CCE194B",
|
||||
"checksum": "7bf1cb6710601519d3fb860db2f613e5f652693f42590739eaa0e2826e3ebf3e"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DC92DF4F04D52B",
|
||||
"checksum": "0f28edc8c5d611dc6eb773958a553a411d4728d8f14af77152926da5eedb5f05"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"etag": "0x8DC92DF5CDB6DFA",
|
||||
"checksum": "b7b742b28bab6b2022557a7fb9e2d9af9b78f131ea700cd3615cdfda0dda7b53"
|
||||
}
|
||||
},
|
||||
"1.22.8": {
|
||||
"x86_64_linux_musl": {
|
||||
"etag": "0x8DC9221550C37C8",
|
||||
"checksum": "4f919cc3a8ce9d0290e0d7923893dcdc37f3e5c7e29ed1f360484e35c2ec560b"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DC92217C08D7BD",
|
||||
"checksum": "bfc6d0369c4ec8e5d24a58d7ee0f4fd05c14f5de7506cf1cbd2c3d0742ff06fa"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DC9221705C4AA4",
|
||||
"checksum": "a0e1a80c2d6bf6226a20648cb82a58b0b272a0f414491d93b3a18a692f5b8d42"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"etag": "0x8DC922172FCD647",
|
||||
"checksum": "4a5677d83d72a93a25f426fab39ec9c747d47b8de25323bd2cf8fcad90a49ce1"
|
||||
}
|
||||
},
|
||||
"1.22.7": {
|
||||
"x86_64_linux_musl": {
|
||||
|
||||
22
manifests/zola.json
generated
22
manifests/zola.json
generated
@@ -16,10 +16,28 @@
|
||||
},
|
||||
"license_markdown": "[MIT](https://github.com/getzola/zola/blob/master/LICENSE)",
|
||||
"latest": {
|
||||
"version": "0.19.0"
|
||||
"version": "0.19.1"
|
||||
},
|
||||
"0.19": {
|
||||
"version": "0.19.0"
|
||||
"version": "0.19.1"
|
||||
},
|
||||
"0.19.1": {
|
||||
"x86_64_linux_gnu": {
|
||||
"etag": "0x8DC949544635A86",
|
||||
"checksum": "90b49041ccab8fbb6955914c41e72774771a6dcbd58936fb107aa8409cb44aa0"
|
||||
},
|
||||
"x86_64_macos": {
|
||||
"etag": "0x8DC94956219151C",
|
||||
"checksum": "fa7b14ab74dab6cd1f49948bb018a8f2c02c662144a25795c067dd482ac1fe7f"
|
||||
},
|
||||
"x86_64_windows": {
|
||||
"etag": "0x8DC949675FDE404",
|
||||
"checksum": "78517521b2db147428ec3f2a7b3a2f7a24d3901509bce56cff44d6de1d369c26"
|
||||
},
|
||||
"aarch64_macos": {
|
||||
"etag": "0x8DC94960573E19B",
|
||||
"checksum": "e867e04eb9af37726b6e1a8f72224ef80c2d307286f700cea5f2c21f63f8ebd5"
|
||||
}
|
||||
},
|
||||
"0.19.0": {
|
||||
"x86_64_linux_gnu": {
|
||||
|
||||
@@ -7,7 +7,7 @@ use std::{
|
||||
ffi::OsStr,
|
||||
io::Read,
|
||||
path::Path,
|
||||
sync::{LazyLock, RwLock},
|
||||
sync::{OnceLock, RwLock},
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
@@ -649,38 +649,43 @@ struct GitHubTokens {
|
||||
other: RwLock<Option<String>>,
|
||||
}
|
||||
impl GitHubTokens {
|
||||
fn get(&self, url: &str) -> Option<String> {
|
||||
// TODO: Use std::sync::LazyLock once 1.80 is released
|
||||
fn get_github_tokens() -> &'static GitHubTokens {
|
||||
static GITHUB_TOKENS: OnceLock<GitHubTokens> = OnceLock::new();
|
||||
GITHUB_TOKENS.get_or_init(|| {
|
||||
let token = env::var("GITHUB_TOKEN").ok().filter(|v| !v.is_empty());
|
||||
GitHubTokens {
|
||||
raw: RwLock::new(token.clone()),
|
||||
api: RwLock::new(token.clone()),
|
||||
other: RwLock::new(token),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn get(url: &str) -> Option<String> {
|
||||
if url.starts_with("https://raw.githubusercontent.com/") {
|
||||
self.raw.read().unwrap().clone()
|
||||
Self::get_github_tokens().raw.read().unwrap().clone()
|
||||
} else if url.starts_with("https://api.github.com/") {
|
||||
self.api.read().unwrap().clone()
|
||||
Self::get_github_tokens().api.read().unwrap().clone()
|
||||
} else if url.starts_with("https://github.com/") {
|
||||
self.other.read().unwrap().clone()
|
||||
Self::get_github_tokens().other.read().unwrap().clone()
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
fn clear(&self, url: &str) {
|
||||
fn clear(url: &str) {
|
||||
if url.starts_with("https://raw.githubusercontent.com/") {
|
||||
*self.raw.write().unwrap() = None;
|
||||
*Self::get_github_tokens().raw.write().unwrap() = None;
|
||||
} else if url.starts_with("https://api.github.com/") {
|
||||
*self.api.write().unwrap() = None;
|
||||
*Self::get_github_tokens().api.write().unwrap() = None;
|
||||
} else if url.starts_with("https://github.com/") {
|
||||
*self.other.write().unwrap() = None;
|
||||
*Self::get_github_tokens().other.write().unwrap() = None;
|
||||
}
|
||||
}
|
||||
}
|
||||
static GITHUB_TOKENS: LazyLock<GitHubTokens> = LazyLock::new(|| {
|
||||
let token = env::var("GITHUB_TOKEN").ok().filter(|v| !v.is_empty());
|
||||
GitHubTokens {
|
||||
raw: RwLock::new(token.clone()),
|
||||
api: RwLock::new(token.clone()),
|
||||
other: RwLock::new(token),
|
||||
}
|
||||
});
|
||||
|
||||
fn download(url: &str) -> Result<ureq::Response> {
|
||||
let mut token = GITHUB_TOKENS.get(url);
|
||||
let mut token = GitHubTokens::get(url);
|
||||
let mut retry = 0;
|
||||
let mut retry_time = 0;
|
||||
let mut max_retry = 6;
|
||||
@@ -702,7 +707,7 @@ fn download(url: &str) -> Result<ureq::Response> {
|
||||
retry_time = 0;
|
||||
token = None;
|
||||
// rate limit
|
||||
GITHUB_TOKENS.clear(url);
|
||||
GitHubTokens::clear(url);
|
||||
}
|
||||
retry += 1;
|
||||
if retry > max_retry {
|
||||
@@ -716,7 +721,7 @@ fn download(url: &str) -> Result<ureq::Response> {
|
||||
|
||||
fn github_head(url: &str) -> Result<()> {
|
||||
eprintln!("fetching head of {url} ..");
|
||||
let mut token = GITHUB_TOKENS.get(url);
|
||||
let mut token = GitHubTokens::get(url);
|
||||
let mut retry = 0;
|
||||
let mut retry_time = 0;
|
||||
let mut max_retry = 2;
|
||||
@@ -739,7 +744,7 @@ fn github_head(url: &str) -> Result<()> {
|
||||
if token.is_some() && retry == max_retry / 2 {
|
||||
retry_time = 0;
|
||||
token = None;
|
||||
GITHUB_TOKENS.clear(url);
|
||||
GitHubTokens::clear(url);
|
||||
}
|
||||
retry += 1;
|
||||
if retry > max_retry {
|
||||
|
||||
@@ -10,11 +10,11 @@ cd "$(dirname "$0")"/..
|
||||
# ./tools/manifest.sh [PACKAGE [VERSION_REQ]]
|
||||
|
||||
if [[ $# -gt 0 ]]; then
|
||||
cargo +nightly run --manifest-path tools/codegen/Cargo.toml --release -- "$@"
|
||||
cargo run --manifest-path tools/codegen/Cargo.toml --release -- "$@"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for manifest in tools/codegen/base/*.json; do
|
||||
package=$(basename "${manifest%.*}")
|
||||
cargo +nightly run --manifest-path tools/codegen/Cargo.toml --release -- "${package}" latest
|
||||
cargo run --manifest-path tools/codegen/Cargo.toml --release -- "${package}" latest
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user