-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #396 from vim-denops/check-support-version
☕ Add `denops/supported-versions.json` and check if all information is updated
- Loading branch information
Showing
5 changed files
with
154 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,10 @@ jobs: | |
run: deno fmt --check | ||
- name: Type check | ||
run: deno task check | ||
- name: Supported version inconsistency check | ||
run: | | ||
deno task apply:supported-versions | ||
git diff --exit-code | ||
test: | ||
needs: check | ||
|
@@ -50,8 +54,8 @@ jobs: | |
- windows-latest | ||
- macos-latest | ||
- ubuntu-latest | ||
version: | ||
- "1.45.x" | ||
deno_version: | ||
- "1.45.0" | ||
- "1.x" | ||
host_version: | ||
- vim: "v9.1.0448" | ||
|
@@ -67,7 +71,7 @@ jobs: | |
|
||
- uses: denoland/[email protected] | ||
with: | ||
deno-version: "${{ matrix.version }}" | ||
deno-version: "${{ matrix.deno_version }}" | ||
|
||
- uses: rhysd/action-setup-vim@v1 | ||
id: vim | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import supportedVersions from "../denops/supported_versions.json" with { | ||
type: "json", | ||
}; | ||
|
||
async function main(): Promise<void> { | ||
await updateREADME(); | ||
await updatePluginDenops(); | ||
await updateGithubWorkflowsTest(); | ||
} | ||
|
||
async function updateREADME(): Promise<void> { | ||
const url = new URL(import.meta.resolve("../README.md")); | ||
let text = await Deno.readTextFile(url); | ||
// Deno | ||
text = text.replace( | ||
/Deno\s+\d+\.\d+\.\d+/, | ||
`Deno ${supportedVersions.deno}`, | ||
); | ||
text = text.replace( | ||
/Deno-Support%20\d+\.\d+\.\d+/, | ||
`Deno-Support%20${supportedVersions.deno}`, | ||
); | ||
text = text.replace( | ||
/https:\/\/github\.com\/denoland\/deno\/tree\/v\d+\.\d+\.\d+/, | ||
`https://github.com/denoland/deno/tree/v${supportedVersions.deno}`, | ||
); | ||
// Vim | ||
text = text.replace( | ||
/Vim\s+\d+\.\d+\.\d+/, | ||
`Vim ${supportedVersions.vim}`, | ||
); | ||
text = text.replace( | ||
/Vim-Support%20\d+\.\d+\.\d+/, | ||
`Vim-Support%20${supportedVersions.vim}`, | ||
); | ||
text = text.replace( | ||
/https:\/\/github\.com\/vim\/vim\/tree\/v\d+\.\d+\.\d+/, | ||
`https://github.com/vim/vim/tree/v${supportedVersions.vim}`, | ||
); | ||
// Neovim | ||
text = text.replace( | ||
/Neovim\s+\d+\.\d+\.\d+/, | ||
`Neovim ${supportedVersions.neovim}`, | ||
); | ||
text = text.replace( | ||
/Neovim-Support%20\d+\.\d+\.\d+/, | ||
`Neovim-Support%20${supportedVersions.neovim}`, | ||
); | ||
text = text.replace( | ||
/https:\/\/github\.com\/neovim\/neovim\/tree\/v\d+\.\d+\.\d+/, | ||
`https://github.com/neovim/neovim/tree/v${supportedVersions.neovim}`, | ||
); | ||
await Deno.writeTextFile(url, text); | ||
} | ||
|
||
async function updatePluginDenops(): Promise<void> { | ||
const url = new URL(import.meta.resolve("../plugin/denops.vim")); | ||
let text = await Deno.readTextFile(url); | ||
// Vim | ||
text = text.replace(/patch-\d+\.\d+\.\d+/, `patch-${supportedVersions.vim}`); | ||
text = text.replace( | ||
/Vim\s+\d+\.\d+\.\d+/, | ||
`Vim ${supportedVersions.vim}`, | ||
); | ||
// Neovim | ||
text = text.replace(/nvim-\d+\.\d+\.\d+/, `nvim-${supportedVersions.neovim}`); | ||
text = text.replace( | ||
/Neovim\s+\d+\.\d+\.\d+/, | ||
`Neovim ${supportedVersions.neovim}`, | ||
); | ||
await Deno.writeTextFile(url, text); | ||
} | ||
|
||
async function updateGithubWorkflowsTest(): Promise<void> { | ||
const url = new URL(import.meta.resolve("../.github/workflows/test.yml")); | ||
let text = await Deno.readTextFile(url); | ||
// Deno | ||
text = text.replace( | ||
/deno_version:(.*?)"\d+\.\d+\.\d+"/s, | ||
`deno_version:$1"${supportedVersions.deno}"`, | ||
); | ||
// Vim | ||
text = text.replace( | ||
/vim:(.*?)"v\d+\.\d+\.\d+"/s, | ||
`vim:$1"v${supportedVersions.vim}"`, | ||
); | ||
// Neovim | ||
text = text.replace( | ||
/nvim:(.*?)"v\d+\.\d+\.\d+"/s, | ||
`nvim:$1"v${supportedVersions.neovim}"`, | ||
); | ||
await Deno.writeTextFile(url, text); | ||
} | ||
|
||
if (import.meta.main) { | ||
try { | ||
await main(); | ||
} catch (error) { | ||
console.error(error); | ||
Deno.exit(1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"deno": "1.45.0", | ||
"vim": "9.1.0448", | ||
"neovim": "0.10.0" | ||
} |