Skip to content

Commit

Permalink
fix: example_windows.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
DVKunion committed Mar 31, 2023
1 parent ca8fa13 commit a0bfaee
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/example_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
runner:
runs-on: windows-latest
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
- name: collie
Expand Down
28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@

Collie-Trickster 基于 牧云主机助手 (Collie) 实现的Github Action。主要用于更便捷的使用和Debug Github Action。

目前支持了:
+ linux ci环境 通过 `手动推送`/`HTTP请求触发` 注册到牧云主机助手,并可以通过牧云主机助手卸载来完成ci。
+ windows主机支持(等待牧云开放接口,脚本已支持)

## 🧑‍🤝‍🧑 友情提示

**关于风险**
**# 关于风险**

> 其实大家都知道所谓 "白嫖国外主机" 不过是个噱头 -_-
>
Expand All @@ -23,15 +27,15 @@ Collie-Trickster 基于 牧云主机助手 (Collie) 实现的Github Action。主
> 说到底,和大家开了个玩笑,`Collie-Trickster`的目的从一开始就是一个debug工具的定位。
> 任何使用`Collie-Trickster`作恶而导致可能面临的风险,包括github封号的情况,`Collie-Trickster`不承担任何责任。
**助手限制**
**# 助手限制**
<details><summary>See More</summary>

牧云主机助手目前默认仅免费三台主机,超过三台主机的使用量时,需要切换付费版本。
也可以不切换,但是三台以上的机器无法成功注册。

</details>

**一些其他的声音**
**# 一些其他的声音**
<details><summary>See More</summary>

</details>
Expand Down Expand Up @@ -98,11 +102,16 @@ git push
### 高级: 切换主机系统(Windows)

<details><summary>CLICK ME</summary>

</details>

### 高级: 通过http触发器自动触发的workflow模版

<details><summary>CLICK ME</summary>

> 注意:这种方式在ci页面会暴露你的牧云助手token信息!请确保不要使用长期token的模式,
> 重要的事重复一遍!请使用一次性安装的token! 不要使用长期token!
每次推送代码才能触发实在太蠢了。当然也十分的不够优雅,需要手动把token放在github secrets中。

在基础用法的基础上,这里给出一份通过`workflow_dispatch` 利用方式:
Expand Down Expand Up @@ -131,9 +140,11 @@ jobs:
host_type: ${{ inputs.type }}
```
使用时,需要你生成一个 [Github Token](https://github.com/settings/tokens/) ,作为认证用;然后将这份`yaml`放在你的仓库`.github/workflows/example.yml`,
使用时,需要你生成一个 [Github Token](https://github.com/settings/tokens/) ,作为认证用;
然后将这份`yaml`放在你的仓库`.github/workflows/example.yml`,或者直接fork本仓库也可以。

然后发起http请求, 这里给出一个curl的调用:
最后发起一个http请求, 这里给出一个curl的调用:

```shell
curl \
Expand All @@ -153,6 +164,13 @@ curl \

这样,每发起一次请求,就会执行一次CI。成功上线一台主机。

> url为 `https://api.github.com/repos/<YOUR_GITHUB_USER_NAME>/<YOUR_GITHUB_REPOS>/actions/workflows/example.yml/dispatches` 时
> 触发的对象为 <YOUR_GITHUB_USER_NAME>/<YOUR_GITHUB_REPOS>/actions/workflows/example.yml
> 如果是fork的仓库,这份yaml默认为linux主机脚本
>
> 想使用windows时, 对应的yaml脚本为:<YOUR_GITHUB_USER_NAME>/<YOUR_GITHUB_REPOS>/actions/workflows/example_windows.yml
> 同时在http请求里, 替换请求体的json参数: `'{"ref":"main","inputs":{"token":"<YOUR_TOKEN>","type": "windows"}'`

</details>

## 🎈 更有趣的玩法
Expand Down
31 changes: 24 additions & 7 deletions README_EN.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
<h1 align="center"> Collie-Trickster </h1>

<p align="center">Get An Free foreign hosts through GitHub Action [doge] </ p>
<p align="center">Get An Free foreign hosts through GitHub Action [doge] </p>

<p align="center"> <a href="README_EN. md">Chinese Documents</a> | English</p>
<p align="center"> <a href="README_EN.md">Chinese Documents</a> | English</p>

<p align="center"> <b>Collie-Trickster introduction</b> </p>

Collie Trickster is based on the MuYun Virtual Machine Assistant (Collie), Github Action implemented. Mainly used for more convenient use and Debug Github Action.

Currently supported:

+ The Linux ci environment registers with the MuYun virtual machine assistant through `manual push`/`HTTP request trigger`, and can complete ci by uninstalling the MuYun virtual machine assistant.

+ Windows host support

## 🧑‍🤝‍🧑 Friendly reminder

**About Risk**
**# About Risk**

> Actually, everyone knows that the so-called "Get An Free foreign hosts" is just a gimmick -_-
>
Expand All @@ -24,7 +30,7 @@ Collie Trickster is based on the MuYun Virtual Machine Assistant (Collie), Githu
>
> `Collie Trickster` does not assume any responsibility for any possible risks that may arise from using `Collie Strickster` to commit crimes, including the Github seal.".
**MuYun Virtual Machine Assistant Limit**
**# MuYun Virtual Machine Assistant Limit**

<details><summary>See More</summary>

Expand All @@ -34,7 +40,7 @@ You can also not switch, but more than three machines cannot successfully regist

</details>

**Some other sounds**
**# Some other sounds**

<details><summary>See More</summary>
</details>
Expand Down Expand Up @@ -111,6 +117,9 @@ git push

<details><summary>CLICK ME</summary>

> Note: This way on the ci page will expose your cloud assistant token information! Please ensure that you do not use the long-term token mode,
> Repeat the important thing! Please use a one-time installed token! Do not use long-term tokens!
It's foolish to trigger every time you push code. Of course, it is not elegant enough. You need to manually place the token in github secrets.

Based on the basic usage, here is a copy of the `workflow_dispatch` method:
Expand Down Expand Up @@ -142,9 +151,9 @@ jobs:
When using, you need to generate a [Github Token](https://github.com/settings/tokens/) For authentication purposes;
Then place this' yaml 'in your warehouse'. github/workflows/example. yml ',
Then place this' yaml 'in your warehouse'.github/workflows/example.yml', Or directly fork the warehouse.
Then initiate a http request, and here is a curl call:
Finally, a http request is issued, and here is a curl call:
```shell
curl \
Expand All @@ -165,6 +174,14 @@ Including:

This way, the CI is executed every time a request is initiated. and successfully launched a host.


> The url is` https://api.github.com/repos/<YOUR_GITHUB_USER_NAME>/<YOUR_GITHUB_REPOS>/actions/workflows/example.yml/dispatches`
> Triggered object is <YOUR_GITHUB_USER_NAME>/<YOUR_GITHUB_REPOS>/actions/workflows/example.yml
> If it's a fork repository, this yaml defaults to a Linux host script
>
> When you want to use Windows, the corresponding yaml script is: <YOUR_GITHUB_USER_NAME>/<YOUR_GITHUB_REPOS>/actions/workflows/example_windows.yml
> In the http request, replace the json parameters of the request body: '{"ref": "main", "inputs": {"token": "<YOUR_TOKEN>", "type": "windows"}'`

</details>

## 🎈 More fun ways to play
Expand Down
4 changes: 3 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ runs:
if: ${{ inputs.host_type == 'windows'}}
run: |
Invoke-WebRequest -Uri 'http://collie-agent.chaitin.com:1443/api/v1/lighter/installer?arch=x86_64&os_type=windows&token=${{ inputs.token }}' -OutFile "install.exe"
Start-Process install.exe -Wait
Start-Process .\install.exe
Set-ExecutionPolicy RemoteSigned -Force
.\check.ps1
shell: powershell
4 changes: 2 additions & 2 deletions check.ps1
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 要监听的进程名
$processName = "collie.exe"
# 要运行的进程名
$processName = "collie"

# 循环监听进程状态
while ($true) {
Expand Down

0 comments on commit a0bfaee

Please sign in to comment.