Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: version-fox/vfox
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.2.0
Choose a base ref
...
head repository: version-fox/vfox
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Jan 12, 2024

  1. doc: update Chinese readme

    aooohan committed Jan 12, 2024
    Copy the full SHA
    7274b0a View commit details
  2. update Chinese readme

    aooohan committed Jan 12, 2024
    Copy the full SHA
    8b91e4d View commit details
  3. bugfix: Change #compdef $PROG to #compdef vfox in zsh completion script

    Previously, the zsh completion script used a variable $PROG for the #compdef directive. This required the user to set the $PROG variable to 'vfox' before sourcing the script for the completion to work correctly.
    
    close #16
    aooohan committed Jan 12, 2024
    Copy the full SHA
    f7fd3a8 View commit details
  4. Create CODE_OF_CONDUCT.md

    aooohan authored Jan 12, 2024
    Copy the full SHA
    44dc21e View commit details
  5. Create CONTRIBUTING.md

    aooohan authored Jan 12, 2024
    Copy the full SHA
    9b61eef View commit details
  6. chore: update license

    aooohan committed Jan 12, 2024
    Copy the full SHA
    693d6b6 View commit details
  7. Update CONTRIBUTING.md

    aooohan authored Jan 12, 2024
    Copy the full SHA
    7df86ba View commit details

Commits on Jan 15, 2024

  1. chore: add star history

    aooohan committed Jan 15, 2024
    Copy the full SHA
    40b6d9e View commit details

Commits on Jan 16, 2024

  1. bugfix: fish hook script

    aooohan committed Jan 16, 2024
    Copy the full SHA
    523f027 View commit details
  2. Copy the full SHA
    74b9fe4 View commit details
  3. Update issue templates

    aooohan authored Jan 16, 2024
    Copy the full SHA
    c0a47c4 View commit details

Commits on Jan 17, 2024

  1. optimize: error log output

    close #21
    aooohan committed Jan 17, 2024
    Copy the full SHA
    0e426fd View commit details

Commits on Jan 18, 2024

  1. release v0.2.1🎉

    aooohan committed Jan 18, 2024
    Copy the full SHA
    eb0356a View commit details
  2. Copy the full SHA
    3fa4d9e View commit details
  3. mod: Use the plugin name as the installed sdk name

    Previously the plugin's filename was used as the sdk name.
    aooohan committed Jan 18, 2024
    Copy the full SHA
    b221f57 View commit details

Commits on Jan 22, 2024

  1. Support proxy configuration #4 (#27)

    Sometimes it may be necessary to run under network control or proxy network, so we allow users to customize their own proxy configuration.
    
    ---------
    
    Co-authored-by: lihan <lihan@apache.org>
    ShizheChang and aooohan authored Jan 22, 2024
    Copy the full SHA
    f992618 View commit details
  2. chore: move package

    aooohan committed Jan 22, 2024
    Copy the full SHA
    215ea52 View commit details
  3. feat: following #4

    * Create an empty config yaml file when config file not exists.
    
    * Enables the http module to use the configured proxy as well.
    aooohan committed Jan 22, 2024
    Copy the full SHA
    c4f6d44 View commit details

Commits on Jan 23, 2024

  1. Copy the full SHA
    5763ac1 View commit details
  2. Copy the full SHA
    c738772 View commit details

Commits on Jan 24, 2024

  1. release v0.2.2🎉🎉

    aooohan committed Jan 24, 2024
    Copy the full SHA
    6bc8164 View commit details

Commits on Jan 29, 2024

  1. feat: Support custom storage path#5

    The default cache path is under the home directory ($HOME/.version-fox/cache). Installing numerous SDKs can consume significant space in this directory. Allowing customization of the storage path can help manage this issue.
    
    close #5
    ---------
    
    Co-authored-by: Xuzhe Cheung <joneicu@163.com>
    aooohan and ShizheChang committed Jan 29, 2024
    Copy the full SHA
    627330f View commit details
  2. chore: update readme

    aooohan committed Jan 29, 2024
    Copy the full SHA
    51c130e View commit details
  3. chore: update .gitignore

    aooohan committed Jan 29, 2024
    Copy the full SHA
    5b984aa View commit details
  4. chore: clean

    aooohan committed Jan 29, 2024
    Copy the full SHA
    bee66ca View commit details
  5. chore: update README_CN.md

    aooohan committed Jan 29, 2024
    Copy the full SHA
    9944d38 View commit details

Commits on Jan 30, 2024

  1. Copy the full SHA
    d9dd993 View commit details

Commits on Jan 31, 2024

  1. chore: update readme

    aooohan committed Jan 31, 2024
    Copy the full SHA
    703e1a3 View commit details
  2. feat: Support plugin to install local files instead of remote files

    Previously, the plugin's Preinstall function was only allowed to return the url of a remote file, e.g. http://xxx. Local files are now supported.
    aooohan committed Jan 31, 2024
    Copy the full SHA
    8888f41 View commit details

Commits on Feb 1, 2024

  1. mod: Adjust the plug-in structure to make it more flexible

    The PreInstall function only handles pre-installation information for the sdk, such as version number, download address, etc., except for the version number, which is not required.
    The PostInstall function as an extension, such as compiling source code, etc.
    aooohan committed Feb 1, 2024
    Copy the full SHA
    167de5d View commit details
  2. feat: Verify the minimum runtime version supported by the plug-in

    In order to better upgrade the plug-in system in the future, plugins are now supported to specify the minimum runtime version that is compatible with running. If not configured, it means that the full version of the plug-in is available
    aooohan committed Feb 1, 2024
    Copy the full SHA
    0bc5b1d View commit details
  3. Delete .DS_Store

    aooohan authored Feb 1, 2024
    Copy the full SHA
    1d4063d View commit details
  4. mod: streamline code

    aooohan committed Feb 1, 2024
    Copy the full SHA
    b02b441 View commit details
  5. mod: Optimize plugin code

    aooohan committed Feb 1, 2024
    Copy the full SHA
    d8300ba View commit details
  6. Copy the full SHA
    2a4fc77 View commit details

Commits on Feb 2, 2024

  1. mod: Optimize the PostInstall and PreInstall structure of the plugin

    * It is clear that the PreInstall function is responsible for providing the meta-information of the current version (including version number, download address, attached file address), and vfox helps download and verify the file.
    aooohan committed Feb 2, 2024
    Copy the full SHA
    b41c2e6 View commit details
  2. bugfix: Invalid setting of alias #39

    In the local plug-in system, the name of the sdk depends on the file name of the plug-in.
    When setting an alias, it is equivalent to setting the file name of the plug-in to the name of the alias.
    
    close #39
    aooohan committed Feb 2, 2024
    Copy the full SHA
    1987a2a View commit details
  3. chore: update readme

    aooohan committed Feb 2, 2024
    Copy the full SHA
    68ab6c2 View commit details
  4. chore: update readme

    aooohan committed Feb 2, 2024
    Copy the full SHA
    7e416c6 View commit details

Commits on Feb 4, 2024

  1. Copy the full SHA
    576ada7 View commit details

Commits on Feb 5, 2024

  1. Copy the full SHA
    308c409 View commit details
  2. bugfix: following 576ada7

    aooohan committed Feb 5, 2024
    Copy the full SHA
    0f236a4 View commit details
  3. Copy the full SHA
    32421d1 View commit details
  4. release v0.2.3🎉🎉

    aooohan committed Feb 5, 2024
    Copy the full SHA
    a8411bb View commit details

Commits on Feb 7, 2024

  1. chore: update readme

    aooohan committed Feb 7, 2024
    Copy the full SHA
    429a40a View commit details
  2. chore: discord invite link

    aooohan committed Feb 7, 2024
    Copy the full SHA
    9b4ca42 View commit details

Commits on Feb 20, 2024

  1. bugfix: When configuring environment variables, if this version is no…

    …t installed, then ignore it.
    aooohan committed Feb 20, 2024
    Copy the full SHA
    d54f004 View commit details

Commits on Feb 21, 2024

  1. Update README.md

    discord link
    aooohan authored Feb 21, 2024
    Copy the full SHA
    c2d2206 View commit details

Commits on Feb 22, 2024

  1. bugfix: Make sure that the target file has been decompressed when rec…

    …onfiguring soft link.
    aooohan committed Feb 22, 2024
    Copy the full SHA
    2d75a9b View commit details

Commits on Feb 23, 2024

  1. Copy the full SHA
    e8cb133 View commit details
Showing with 44,061 additions and 3,053 deletions.
  1. BIN .DS_Store
  2. +14 −0 .github/FUNDING.yml
  3. +19 −0 .github/ISSUE_TEMPLATE/bug_report.md
  4. +8 −0 .github/ISSUE_TEMPLATE/config.yml
  5. +14 −0 .github/ISSUE_TEMPLATE/feature_request.md
  6. +17 −0 .github/ISSUE_TEMPLATE/question_answer.md
  7. +33 −0 .github/workflows/ci.yml
  8. +72 −0 .github/workflows/documentation.yml
  9. +1 −1 .github/workflows/go-releaser.yml
  10. +8 −0 .gitignore
  11. +8 −10 .goreleaser.yaml
  12. +0 −8 .idea/.gitignore
  13. +0 −6 .idea/copyright/apache.xml
  14. +0 −7 .idea/copyright/profiles_settings.xml
  15. +0 −20 .idea/inspectionProfiles/Project_Default.xml
  16. +0 −8 .idea/modules.xml
  17. +0 −6 .idea/vcs.xml
  18. +0 −9 .idea/version-fox.iml
  19. +1 −0 .tool-versions
  20. +1 −0 CNAME
  21. +128 −0 CODE_OF_CONDUCT.md
  22. +41 −0 CONTRIBUTING.md
  23. +1 −1 LICENSE
  24. +87 −53 README.md
  25. +73 −460 README_CN.md
  26. +29 −10 cmd/cmd.go
  27. +29 −13 cmd/commands/activate.go
  28. +26 −9 cmd/commands/add.go
  29. +18 −24 cmd/commands/available.go
  30. +4 −0 cmd/commands/base.go
  31. +59 −0 cmd/commands/cd.go
  32. +175 −0 cmd/commands/config.go
  33. +11 −6 cmd/commands/current.go
  34. +109 −30 cmd/commands/env.go
  35. +20 −12 cmd/commands/info.go
  36. +217 −23 cmd/commands/install.go
  37. +14 −12 cmd/commands/list.go
  38. +7 −6 cmd/commands/remove.go
  39. +71 −51 cmd/commands/search.go
  40. +13 −11 cmd/commands/uninstall.go
  41. +45 −12 cmd/commands/update.go
  42. +213 −0 cmd/commands/upgrade.go
  43. +7 −9 internal/sdk/scope.go → cmd/commands/upgrade_unix.go
  44. +74 −0 cmd/commands/upgrade_win.go
  45. +19 −19 cmd/commands/use.go
  46. +9 −0 codecov.yml
  47. +2 −2 completions/zsh_autocomplete
  48. +269 −0 docs/.vitepress/cache/deps/@theme_index.js
  49. +7 −0 docs/.vitepress/cache/deps/@theme_index.js.map
  50. +58 −0 docs/.vitepress/cache/deps/_metadata.json
  51. +9,092 −0 docs/.vitepress/cache/deps/chunk-TM5ZW4YT.js
  52. +7 −0 docs/.vitepress/cache/deps/chunk-TM5ZW4YT.js.map
  53. +11,402 −0 docs/.vitepress/cache/deps/chunk-Z6B2QTD3.js
  54. +7 −0 docs/.vitepress/cache/deps/chunk-Z6B2QTD3.js.map
  55. +3 −0 docs/.vitepress/cache/deps/package.json
  56. +2,580 −0 docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js
  57. +7 −0 docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map
  58. +567 −0 docs/.vitepress/cache/deps/vitepress___@vueuse_core.js
  59. +7 −0 docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map
  60. +1,093 −0 docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js
  61. +7 −0 docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js.map
  62. +1,665 −0 docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js
  63. +7 −0 docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js.map
  64. +1,856 −0 docs/.vitepress/cache/deps/vitepress___minisearch.js
  65. +7 −0 docs/.vitepress/cache/deps/vitepress___minisearch.js.map
  66. +323 −0 docs/.vitepress/cache/deps/vue.js
  67. +7 −0 docs/.vitepress/cache/deps/vue.js.map
  68. +45 −0 docs/.vitepress/config.mts
  69. +98 −0 docs/.vitepress/en.ts
  70. +106 −0 docs/.vitepress/zh.ts
  71. +1 −0 docs/CNAME
  72. +114 −0 docs/guides/configuration.md
  73. +29 −0 docs/guides/faq.md
  74. +56 −0 docs/guides/intro.md
  75. +287 −0 docs/guides/quick-start.md
  76. +64 −0 docs/index.md
  77. +39 −0 docs/misc/vs-asdf.md
  78. +1,660 −0 docs/package-lock.json
  79. +13 −0 docs/package.json
  80. +91 −0 docs/plugins/available.md
  81. +321 −0 docs/plugins/create/howto.md
  82. +86 −0 docs/plugins/create/howto_registry.md
  83. +11 −0 docs/plugins/library/archiver.md
  84. +17 −0 docs/plugins/library/html.md
  85. +41 −0 docs/plugins/library/http.md
  86. +15 −0 docs/plugins/library/json.md
  87. +21 −0 docs/plugins/library/strings.md
  88. BIN docs/public/demo-full.gif
  89. BIN docs/public/logo.png
  90. +13 −0 docs/public/logo.svg
  91. BIN docs/public/performance.png
  92. +20 −0 docs/usage/all-commands.md
  93. +156 −0 docs/usage/core-commands.md
  94. +90 −0 docs/usage/plugins-commands.md
  95. +71 −0 docs/usage/shims-path.md
  96. +111 −0 docs/zh-hans/guides/configuration.md
  97. +28 −0 docs/zh-hans/guides/faq.md
  98. +51 −0 docs/zh-hans/guides/intro.md
  99. +269 −0 docs/zh-hans/guides/quick-start.md
  100. +64 −0 docs/zh-hans/index.md
  101. +35 −0 docs/zh-hans/misc/vs-asdf.md
  102. +91 −0 docs/zh-hans/plugins/available.md
  103. +310 −0 docs/zh-hans/plugins/create/howto.md
  104. +76 −0 docs/zh-hans/plugins/create/howto_registry.md
  105. +10 −0 docs/zh-hans/plugins/library/archiver.md
  106. +16 −0 docs/zh-hans/plugins/library/html.md
  107. +40 −0 docs/zh-hans/plugins/library/http.md
  108. +16 −0 docs/zh-hans/plugins/library/json.md
  109. +21 −0 docs/zh-hans/plugins/library/strings.md
  110. +20 −0 docs/zh-hans/usage/all-commands.md
  111. +159 −0 docs/zh-hans/usage/core-commands.md
  112. +86 −0 docs/zh-hans/usage/plugins-commands.md
  113. +73 −0 docs/zh-hans/usage/shims-path.md
  114. +28 −15 go.mod
  115. +271 −33 go.sum
  116. +62 −57 install.sh
  117. +138 −0 internal/cache/cache.go
  118. +142 −0 internal/cache/cache_test.go
  119. +11 −2 internal/{sdk → }/checksum.go
  120. +92 −0 internal/config/cache.go
  121. +74 −0 internal/config/cache_test.go
  122. +95 −0 internal/config/config.go
  123. +15 −0 internal/config/config.yaml
  124. +80 −0 internal/config/config_test.go
  125. 0 internal/config/empty_test.yaml
  126. +8 −15 internal/{sdk/version.go → config/legacy_version_file.go}
  127. +29 −0 internal/config/proxy.go
  128. +25 −0 internal/config/registry.go
  129. +23 −22 internal/{sdk/tmp.go → config/storage.go}
  130. +10 −43 internal/env/env.go
  131. +12 −5 internal/env/flag.go
  132. +61 −128 internal/env/macos_env.go
  133. +87 −0 internal/env/path.go
  134. +72 −0 internal/env/path_test.go
  135. +0 −203 internal/env/record.go
  136. +97 −37 internal/env/windows_env.go
  137. +199 −0 internal/interfaces.go
  138. +70 −0 internal/logger/logger.go
  139. +309 −0 internal/luai/decode.go
  140. +129 −0 internal/luai/encode.go
  141. +354 −0 internal/luai/example_test.go
  142. +14 −0 internal/luai/fixtures/preload.lua
  143. +87 −0 internal/luai/vm.go
  144. +837 −0 internal/manager.go
  145. +41 −0 internal/module/archiver/archiver.go
  146. +35 −0 internal/module/archiver/archiver_test.go
  147. BIN internal/module/archiver/testdata/test.zip
  148. +1 −1 internal/module/file/file.go
  149. +3 −31 internal/module/file/file_test.go
  150. +11 −1 internal/module/html/html.go
  151. +11 −1 internal/module/html/html_test.go
  152. +182 −29 internal/module/http/http.go
  153. +77 −5 internal/module/http/http_test.go
  154. +2 −2 internal/module/json/json.go
  155. +59 −26 internal/module/json/json_test.go
  156. +8 −3 internal/module/module.go
  157. +137 −0 internal/module/string/string.go
  158. +104 −0 internal/module/string/string_test.go
  159. +174 −0 internal/package.go
  160. +92 −0 internal/path.go
  161. +629 −0 internal/plugin.go
  162. +397 −0 internal/plugin_test.go
  163. +101 −52 internal/printer/select.go
  164. +7 −2 internal/printer/select_test.go
  165. +41 −0 internal/registry.go
  166. +59 −0 internal/scope.go
  167. +788 −0 internal/sdk.go
  168. +0 −408 internal/sdk/manager.go
  169. +0 −64 internal/sdk/path.go
  170. +0 −368 internal/sdk/plugin.go
  171. +0 −33 internal/sdk/repository.go
  172. +0 −402 internal/sdk/sdk.go
  173. +6 −3 internal/shell/bash.go
  174. +51 −0 internal/shell/clink.go
  175. +160 −0 internal/shell/clink_vfox.lua
  176. +31 −28 internal/shell/fish.go
  177. +1 −1 internal/shell/linux_process.go
  178. +1 −1 internal/shell/macos_process.go
  179. +144 −0 internal/shell/nushell.go
  180. +124 −0 internal/shell/nushell_test.go
  181. +20 −5 internal/shell/powershell.go
  182. +1 −1 internal/shell/process.go
  183. +19 −5 internal/shell/shell.go
  184. +11 −10 internal/shell/windows_process.go
  185. +23 −18 internal/shell/zsh.go
  186. +1 −0 internal/shim/binary/checksum.sha256
  187. +1 −0 internal/shim/binary/checksum.sha512
  188. BIN internal/shim/binary/shim.exe
  189. +12 −21 internal/{util/os.go → shim/shim.go}
  190. +56 −0 internal/shim/shim_unix.go
  191. +107 −0 internal/shim/shim_windows.go
  192. +202 −0 internal/testdata/plugins/java_with_main/main.lua
  193. +18 −0 internal/testdata/plugins/java_with_metadata/hooks/available.lua
  194. +33 −0 internal/testdata/plugins/java_with_metadata/hooks/env_keys.lua
  195. +17 −0 internal/testdata/plugins/java_with_metadata/hooks/parse_legacy_file.lua
  196. +11 −0 internal/testdata/plugins/java_with_metadata/hooks/post_install.lua
  197. +9 −0 internal/testdata/plugins/java_with_metadata/hooks/pre_install.lua
  198. +14 −0 internal/testdata/plugins/java_with_metadata/hooks/pre_uninstall.lua
  199. +40 −0 internal/testdata/plugins/java_with_metadata/hooks/pre_use.lua
  200. +44 −0 internal/testdata/plugins/java_with_metadata/lib/util.lua
  201. +27 −0 internal/testdata/plugins/java_with_metadata/metadata.lua
  202. +81 −0 internal/toolset/file_record.go
  203. +84 −0 internal/toolset/tool_version.go
  204. +285 −13 internal/util/decompressor.go
  205. +1 −1 internal/util/decompressor_test.go
  206. +1 −1 internal/util/downloader.go
  207. +71 −0 internal/util/error_store.go
  208. +76 −1 internal/util/file.go
  209. +9 −14 internal/util/{arch.go → runtime.go}
  210. +139 −0 internal/util/set.go
  211. +108 −0 internal/util/set_test.go
  212. +1 −1 internal/util/time.go
  213. +1 −1 internal/util/time_test.go
  214. +15 −1 internal/util/{verison.go → version.go}
  215. +1 −1 internal/util/version_test.go
  216. +3 −8 internal/{env/scope.go → version.go}
  217. BIN logo.png
  218. +2 −4 main.go
  219. +0 −88 template.lua
Binary file removed .DS_Store
Binary file not shown.
14 changes: 14 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: aooohan
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: 🐛Bug report
about: Create a report to help us improve
title: '[BUG]: Some problem...'
labels: ["bug"]
assignees: ''

---

**Version**
The version you are currently using
**OS**
macOS、Linux、Windows

**Describe the bug**
A clear and concise description of what the bug is.

**Screenshots[optional]**
If applicable, add screenshots to help explain your problem.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: 📜 Documentation
url: https://vfox.lhan.me/
about: Before submitting a question, please read the documentation. If you are still not satisfied, ask a question again.
- name: 👀 GitHub Discussions
url: https://github.com/version-fox/vfox/discussions
about: If your issue is not a feature or bug, go to the discussion panel and retrieve if your issue already exists before submitting it.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: 🚀Feature Request
about: Please describe in detail the features you expect.
title: '[Feature]: Some feature...'
labels: ["enhancement"]
assignees: ''

---

<!-- Please answer these questions before you submit the desired feature. -->

#### 1. Your usage scenarios?

#### 2. What is your expected outcome?
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/question_answer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: 🙋 Question Report
about: Usage question that isn't answered in docs or discussion
title: "[Question] Some question..."
labels: ["question"]
---

<-- Please answer these questions before submitting them. Thank you. -->

**Version**
The version you are currently using

**OS**
macOS、Linux、Windows

**Question Description**
A clear and concise description of what the question is.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: VersionFox CI

on: [push]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
go-version: [ '1.21.x' ]

steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Install dependencies
run: |
go get .
- name: Build
run: |
go build .
- name: Test and coverage
run: |
go test ./... -coverprofile=coverage.out -covermode=atomic
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
72 changes: 72 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Documentation

on:
# trigger deployment on push to master branch when changes to docs/**
push:
paths:
- "docs/**"
branches:
- main
# trigger deployment manually
workflow_dispatch:

permissions:
contents: write
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs/

steps:
- uses: actions/checkout@v4
with:
# fetch all commits to get last updated time or other git log info
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Cache dependencies
uses: actions/cache@v3
id: npm-cache
with:
path: |
**/node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm install

- name: Build VitePress site
run: npm run docs:build

- name: Bundle CNAME with site dist
run: cp CNAME .vitepress/dist


- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion .github/workflows/go-releaser.yml
Original file line number Diff line number Diff line change
@@ -38,6 +38,6 @@ jobs:
env:
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
run: |
for filename in dist/vfox*.{rpm,deb,apk}; do
for filename in dist/vfox*.{rpm,deb}; do
curl -F package=@"$filename" https://{$FURY_TOKEN}@push.fury.io/versionfox/
done
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
.DS_Store
.idea
/docs/node_modules/


coverage.out
**/available.cache

vfox
18 changes: 8 additions & 10 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -17,11 +17,16 @@ builds:
- amd64
- arm
- arm64
- loong64
goarm:
- "7"
ignore:
- goos: windows
goarch: arm
- goos: windows
goarch: loong64
- goos: darwin
goarch: loong64
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath
@@ -94,10 +99,6 @@ brews:
commit_author:
name: "Han Li"
email: aooohan@gmail.com
# dependencies:
# - name: go
# type: optional
# - name: git
test: |
system "#{bin}/vfox version"
extra_install: |-
@@ -129,11 +130,11 @@ nfpms:
section: utils
contents:
- src: ./completions/bash_autocomplete
dst: /usr/share/bash-completions/completions/vfox
dst: /usr/share/bash-completion/completions/vfox
file_info:
mode: 0644
- src: ./completions/zsh_autocomplete
dst: /usr/share/zsh/vendor-completions/_vfox
dst: /usr/share/zsh/site-functions/_vfox
file_info:
mode: 0644
- src: ./LICENSE
@@ -142,7 +143,6 @@ nfpms:
mode: 0644
formats:
- rpm
- apk
- deb
rpm:
group: Development/Tools
@@ -164,8 +164,6 @@ nfpms:
# owner: microsoft
# name: winget-pkgs
# branch: master
sboms:
- artifacts: archive

signs:
- cmd: cosign
@@ -184,4 +182,4 @@ release:
prerelease: true
name_template: "v{{ .Version }}"
footer: |
**Full Changelog**: https://github.com/version-fox/vfox/compare/{{ .PreviousTag }}...{{ .Tag }}
**Full Changelog**: https://github.com/version-fox/vfox/compare/{{ .PreviousTag }}...{{ .Tag }}
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/copyright/apache.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

20 changes: 0 additions & 20 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/version-fox.iml

This file was deleted.

1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
golang 1.21.7
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vfox.lhan.me
Loading