Secrets is recommended

Secrets is recommended.
This commit is contained in:
bitcookies 2022-04-23 22:29:07 +08:00
parent 17b98bc121
commit e93fbee80b
2 changed files with 116 additions and 118 deletions

116
README.md
View file

@ -40,16 +40,17 @@ See [here](README.HOW_DOES_IT_WORK.md).
There are several ways to use it 🧐:
- [Use Github Actions with Push](#4-Use-Github-Actions-with-Push)
- [Use Github Actions with Secrets](#5-Use-Github-Actions-with-Secrets)
- [Use Github Actions with Secrets](#4-Use-Github-Actions-with-Secrets) *(⭐ Recommend)*
- [Use Github Actions with Push](#5-Use-Github-Actions-with-Push)
- [Build in Visual Studio](#6-Build-in-Visual-Studio)
## 4. Use Github Actions with Push
## 4. Use Github Actions with Secrets
<details>
<summary>Click to expand</summary>
Github Action is a CI/CD tool introduced after Microsoft acquired Github, and you can run programs on GitHub Action by following these steps.
Use [Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) you don't need to commits to the repository, so you can fetch upstream without conflicts. So I recommend using this method.
### 4.1 Fork
@ -59,11 +60,61 @@ Github Action is a CI/CD tool introduced after Microsoft acquired Github, and yo
![Fork](assets/fork-dark.png#gh-dark-mode-only)
### 4.2 Creating Secrets
Open your forked repository, and go to **Settings > Secrets > Actions > New repository secret**.
![Secrets](assets/secrets-light.png#gh-light-mode-only)
![Secrets](assets/secrets-dark.png#gh-dark-mode-only)
Create two Secrets named `text1` and `text2` and fill in values.
![Add Secrets](assets/secrets-add-light.png#gh-light-mode-only)
![Add Secrets](assets/secrets-add-dark.png#gh-dark-mode-only)
Once created, you will see:
![Secrets Repo](assets/secrets-repo-light.png#gh-light-mode-only)
![Secrets Repo](assets/secrets-repo-dark.png#gh-dark-mode-only)
### 4.3 Run Workflow
Go to **Actions** and select **WinRAR Keygen Secrets** to run Workflow manually.
![Run](assets/run-workflow-light.png#gh-light-mode-only)
![Run](assets/run-workflow-dark.png#gh-dark-mode-only)
After running successfully, open the corresponding task and select **rarreg_file** to download.
![Download](assets/file-download-light.png##gh-light-mode-only)
![Download](assets/file-download-dark.png#gh-dark-mode-only)
</details>
## 5. Use Github Actions with Push
<details>
<summary>Click to expand</summary>
Using push for key generation is very simple and convenient, but when there are updates to fetch upstream, you need to manually merge conflicts. So I would recommend [use Github Actions with Secrets](#4-Use-Github-Actions-with-Secrets), but you can still use the push action.
### 5.1 Fork
**Fork** this repo.
![Fork](assets/fork-light.png#gh-light-mode-only)
![Fork](assets/fork-dark.png#gh-dark-mode-only)
If you've forked before and I've committed new code, but you don't know how to merge the new content into your repository, then you can delete the current fork and fork again.
### 4.2 Modify info.json
### 5.2 Modify info.json
Go to `keygen/info.json` and click on the edit button to edit the file.
Open your forked repository, and go to `keygen/info.json` and click on the edit button to edit the file.
![Edit](assets/edit-json-light.png#gh-light-mode-only)
@ -93,7 +144,7 @@ Once you have finished making changes, click the **Commit changes** button and G
If Github Actions does not start automatically, you will need to click on the Actions page to **allow this workflows to run**, then modify and commit `keygen/info.json` again.
### 4.3 Download Key
### 5.3 Download Key
Go to **Actions** and select **WinRAR Keygen** to see the status of the program.
@ -113,57 +164,6 @@ If you get an invalid key, please check [the specific solution](#7-invalid-key).
</details>
## 5. Use Github Actions with Secrets
<details>
<summary>Click to expand</summary>
In order to make Merge and Pull easier for everyone, a new method for using Github Actions through [Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) has been added:
### 5.1 Fork
**Fork** this repo.
![Fork](assets/fork-light.png#gh-light-mode-only)
![Fork](assets/fork-dark.png#gh-dark-mode-only)
### 5.2 Creating Secrets
Go to **Settings > Secrets > Actions > New repository secret**:
![Secrets](assets/secrets-light.png#gh-light-mode-only)
![Secrets](assets/secrets-dark.png#gh-dark-mode-only)
Create two Secrets named `text1` and `text2` and fill in values:
![Add Secrets](assets/secrets-add-light.png#gh-light-mode-only)
![Add Secrets](assets/secrets-add-dark.png#gh-dark-mode-only)
Once created, you will see:
![Secrets Repo](assets/secrets-repo-light.png#gh-light-mode-only)
![Secrets Repo](assets/secrets-repo-dark.png#gh-dark-mode-only)
### 5.3 Run Workflow
Go to **Actions** and select **WinRAR Keygen Secrets** to run Workflow manually:
![Run](assets/run-workflow-light.png#gh-light-mode-only)
![Run](assets/run-workflow-dark.png#gh-dark-mode-only)
After running successfully, open the corresponding task and select **rarreg_file** to download.
![Download](assets/file-download-light.png##gh-light-mode-only)
![Download](assets/file-download-dark.png#gh-dark-mode-only)
</details>
## 6. Build in Visual Studio
<details>

View file

@ -40,16 +40,17 @@ WinRAR不是免费软件。如果你想使用它你应当向 [__RARLAB__](htt
有多种方法可供选择 🧐:
+ [通过 Push 使用 Github Actions](#4-通过-Push-使用-Github-Actions)
+ [通过 Secrets 使用 Github Actions](#5-通过-Secrets-使用-Github-Actions)
+ [通过 Secrets 使用 Github Actions](#4-通过-Secrets-使用-Github-Actions) *(⭐ 推荐)*
+ [通过 Push 使用 Github Actions](#5-通过-Push-使用-Github-Actions)
+ [通过 Visual Studio 编译使用](#6-通过-Visual-Studio-编译使用)
## 4. 通过 Push 使用 Github Actions
## 4. 通过 Secrets 使用 Github Actions
<details>
<summary>点击展开</summary>
Github Action 是微软收购 Github 之后推出的 CI/CD 工具,通过以下步骤即可在 GitHub Action 上运行程序:
使用 [Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) 可以不用对仓库代码进行修改,方便你以后可以无冲突的对仓库进行同步更新,所以我优先推荐使用这种方法:
### 4.1 Fork
@ -59,11 +60,61 @@ Github Action 是微软收购 Github 之后推出的 CI/CD 工具,通过以下
![Fork](assets/fork-dark.png#gh-dark-mode-only)
### 4.2 创建 Secrets
打开你 fork 后的仓库,进入 **Settings > Secrets > Actions > New repository secret** 来创建:
![Secrets](assets/secrets-light.png#gh-light-mode-only)
![Secrets](assets/secrets-dark.png#gh-dark-mode-only)
创建两个 Secrets名称为 `text1``text2`,并填入相关值:
![Add Secrets](assets/secrets-add-light.png#gh-light-mode-only)
![Add Secrets](assets/secrets-add-dark.png#gh-dark-mode-only)
创建完成后,你将会看到:
![Secrets Repo](assets/secrets-repo-light.png#gh-light-mode-only)
![Secrets Repo](assets/secrets-repo-dark.png#gh-dark-mode-only)
### 4.3 运行 Workflow
进入 **Actions** 并选择 **WinRAR Keygen Secrets** 来手动执行 Workflow
![Run](assets/run-workflow-light.png#gh-light-mode-only)
![Run](assets/run-workflow-dark.png#gh-dark-mode-only)
运行成功之后,打开对应的任务,选择 **rarreg_file** 下载:
![Download](assets/file-download-light.png##gh-light-mode-only)
![Download](assets/file-download-dark.png#gh-dark-mode-only)
</details>
## 5. 通过 Push 使用 Github Actions
<details>
<summary>点击展开</summary>
使用 push 操作进行 key 的生成非常的简单和方便,但是当有更新同步时你需要手动进行冲突合并。所以我建议优先 [通过 Secrets 使用 Github Actions](#4-通过-Secrets-使用-Github-Actions),但是你仍可以使用 push 操作:
### 5.1 Fork
点击该项目右上角的 **Fork** 按钮fork 一份代码到你的 Github
![Fork](assets/fork-light.png#gh-light-mode-only)
![Fork](assets/fork-dark.png#gh-dark-mode-only)
如果你之前 fork 过,然后我提交了新的代码,但是你不懂得如何合并新内容到你的仓库,那你也可以删掉当前 fork 的仓库,然后重新 fork 一次。
### 4.2 修改 info.json
### 5.2 修改 info.json
进入 `keygen/info.json`,点击编辑按钮,对该文件进行编辑:
打开你 fork 后的仓库,进入 `keygen/info.json`,点击编辑按钮,对该文件进行编辑:
![Edit](assets/edit-json-light.png#gh-light-mode-only)
@ -93,7 +144,7 @@ Github Action 是微软收购 Github 之后推出的 CI/CD 工具,通过以下
如果 Github Actions 未自动开始,你需要先点击 Actions 页面 **允许此 workflows 运行**,然后再次修改并提交 `keygen/info.json`
### 4.3 下载文件
### 5.3 下载文件
进入 **Actions** 并选择 **WinRAR Keygen** 页面查看程序运行状况:
@ -113,59 +164,6 @@ Github Action 是微软收购 Github 之后推出的 CI/CD 工具,通过以下
</details>
## 5. 通过 Secrets 使用 Github Actions
<details>
<summary>点击展开</summary>
为了更好的方便大家 Merge 和 Pull现在新增了通过 [Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) 使用 Github Actions 的方法:
### 5.1 Fork
点击该项目右上角的 **Fork** 按钮fork 一份代码到你的 Github
![Fork](assets/fork-light.png#gh-light-mode-only)
![Fork](assets/fork-dark.png#gh-dark-mode-only)
如果你之前 fork 过,然后我提交了新的代码,但是你不懂得如何合并新内容到你的仓库,那你也可以删掉当前 fork 的仓库,然后重新 fork 一次。
### 5.2 创建 Secrets
进入 **Settings > Secrets > Actions > New repository secret** 来创建:
![Secrets](assets/secrets-light.png#gh-light-mode-only)
![Secrets](assets/secrets-dark.png#gh-dark-mode-only)
创建两个 Secrets名称为 `text1``text2`,并填入相关值:
![Add Secrets](assets/secrets-add-light.png#gh-light-mode-only)
![Add Secrets](assets/secrets-add-dark.png#gh-dark-mode-only)
创建完成后,你将会看到:
![Secrets Repo](assets/secrets-repo-light.png#gh-light-mode-only)
![Secrets Repo](assets/secrets-repo-dark.png#gh-dark-mode-only)
### 5.3 运行 Workflow
进入 **Actions** 并选择 **WinRAR Keygen Secrets** 来手动执行 Workflow
![Run](assets/run-workflow-light.png#gh-light-mode-only)
![Run](assets/run-workflow-dark.png#gh-dark-mode-only)
运行成功之后,打开对应的任务,选择 **rarreg_file** 下载:
![Download](assets/file-download-light.png##gh-light-mode-only)
![Download](assets/file-download-dark.png#gh-dark-mode-only)
</details>
## 6. 通过 Visual Studio 编译使用
<details>