Skip to content

Commit ec171ac

Browse files
committed
Merge branch 'castIe' of https://github.com/rookdev/rookbot into castIe
2 parents c273423 + 47ee6e1 commit ec171ac

File tree

188 files changed

+15019
-5537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+15019
-5537
lines changed

.env.dev.ci

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#/-------------------[DOTENV_PUBLIC_KEY]--------------------/
2+
#/ public-key encryption for .env files /
3+
#/ [how it works](https://dotenvx.com/encryption) /
4+
#/----------------------------------------------------------/
5+
DOTENV_PUBLIC_KEY_DEV_CI="036981fa7d573de729d450c93c9f15d4b9a1f2cbe21391d985e614264cddb8cba0"
6+
7+
# .env.dev.ci
8+
# Run as Development
9+
# DEV: ./env/envs/.env.dev
10+
ENV_ACTIVE="encrypted:BC4yeD37++DxbuPWfzjz4LZqEENyETa9f3Kp+xd/q/bfSnuKhFok1Nfsl5pxKu4/GU3I71a+iFifVwn1nKXRl/C0zKk1CtaNfkqnbldsIxqJKB3S1ecNZbmfqdf0oIXpkEa/vGoDMQAVP9Wr"
11+
12+
# Log in as gitrook
13+
# GITROOK: ./env/devs/.env.token.gitrook
14+
TOKEN="encrypted:BIAxn9VQpxjr3vILGPUQA6vTkmL2bBgqf4p4l1bSkUJMRjk2ica2kq4SRqLV/zV1CHcAscBfpmchouxd7sLIpbYzovO0HiGAt+LPzPUgrbVHLVvPHLz7Q4P0SSgsEHVJr53lcKNnLxCJ8qUHGrNHWu0GlavBFGStbeRGQWtNhy73IZDW3/zKJ+wCEj1TbT/RnSFz+QWZ9f8R5UEug2QM9xo/lVKXW2vWDg=="
15+
GUILD_ID="encrypted:BA3K9uMxry67N9i4KwfSl1UVetpaq4D8lgLah8tLg9Gju609R8G6M5JyA/rwtHOvrGgVKX5CIdkH5LPH2D8CILupvAG4yDdYg/6P9LbrOkM0naLcXDyiakt2pZF12+qciijbDEdIeboPf9Dpl913jPeBVK8="
16+
# Register as gitrook
17+
# GITROOK: ./env/devs/.env.client.gitrook
18+
CLIENT_ID="encrypted:BFdUCJygflVVeco9BROT9qNYHihsknfMjKCYmVz3Xk6GvuyTcvHLCamj0EJRuNoD7szNUfO4+c3zkgyRjLXaHwp9FS9KlKK0t03zVrm/GK7j6N9N766SWhF2xWqNvZUBAqEAtcXWdAXQk8Pk961gyesnahw="

.env.example

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
1-
TOKEN = bot_token_goes_here
2-
DISCORD_CLIENT_ID = bot_app_id_goes_here
1+
# Log in as <User>
2+
# <USER>: ./env/devs/.env.token.<user>
3+
TOKEN = ""
4+
GUILD_ID = ""
5+
# Register as <User>
6+
# <USER>: ./env/devs/.env.client.<user>
7+
CLIENT_ID = ""
8+
9+
# Connect to <Guild>
10+
# <GUILD>: ./env/servers/.env.token.<guild>
11+
TOKEN = ""
12+
GUILD_ID = ""
313

414
# Create an Application: https://discord.com/developers/applications
515
# General Information
616
# Icon, Name
717
# OAuth2
8-
# Client ID
18+
# Client ID = CLIENT_ID
919
# Client Secret
1020
# Bot
1121
# TOKEN = TOKEN
12-
# DISCORD_CLIENT_ID = DISCORD_CLIENT_ID
22+
23+
# Guild ID = GUILD_ID

.env.prod.ci

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#/-------------------[DOTENV_PUBLIC_KEY]--------------------/
2+
#/ public-key encryption for .env files /
3+
#/ [how it works](https://dotenvx.com/encryption) /
4+
#/----------------------------------------------------------/
5+
DOTENV_PUBLIC_KEY_PROD_CI="038048ce416750d231def5f9d8f450a6c165664c49a330c3d52fe1e6afa0fa99d8"
6+
7+
# .env.prod.ci
8+
# Run as Production
9+
# PROD: ./env/envs/.env.prod
10+
ENV_ACTIVE="encrypted:BKRIOVvdz004u0YdYMFzgpryVAgLJplUaNMO+cwQfzGLeEUZ0z0J29DbBWovO2P+KqEa/5LGSpWTSCAMxX3WWJvMtMarKy/9gD7aTBL1T08ZraIN3Vc8/QpK4SpYNQcbNuCwfiorWr0wNGs="
11+
12+
# Log in as gitrook
13+
# GITROOK: ./env/devs/.env.token.gitrook
14+
TOKEN="encrypted:BGR2ACmuBACkkHzNN1KrqX+PjRVGMv/pK0UkdNtkeDSFm2U7o1EINS/pK1XOdHKtr5Ez9vtkvLLZZJWpHexQ07hpzgoCXeC4yzmfRMA2YRGadRp2+ygs7hIzLdDn2aFw+L8HEXhT8ooXDfvqImDC6/by8Lxxn+MfOjdCZwHH/LKbNxv1LjRnZ+sgMJ6qP6WoXXibUaFWho1rCZQMW0ut/3zNsHt4bc0UCQ=="
15+
GUILD_ID="encrypted:BOW3U01mdEGDF5FUn05P59eu73dcmsNdfmvUbluqygP8gNLR87SENDEBONR4bZvAcr+l//tu7jsp8WhkKQyXS+0kFT3R5DVx+TGtI0dmSs5stVJqZcZPvCghKqlpcwS4h/iXFfBe690kYVfOiHvSaaLLVvM="
16+
# Register as gitrook
17+
# GITROOK: ./env/devs/.env.client.gitrook
18+
CLIENT_ID="encrypted:BJa3EeJ2+T0Uoq0sR73Ui/CguCoQC2TUUKu4M8ogt7ADXcS4SGv3GmHKuZ/EvznD4+lvKwnMk1qBA3Tx2CFGLl3udIyjaeX263NkOQW1tVZeQCoCsYx4pvLcUHQmVvrdWHEF/t7/nGucCLa2yLaztn9EEPo="
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: 📁Get Parent Directory
2+
description: Get Parent Directory
3+
4+
outputs:
5+
parentDirNotWin:
6+
description: "Parent Directory (!Windows)"
7+
value: ${{ steps.parentDirNotWin.outputs.value }}
8+
parentDir:
9+
description: "Parent Directory (Windows)"
10+
value: ${{ steps.parentDir.outputs.value }}
11+
12+
#########
13+
# actions
14+
#########
15+
# mad9000/actions-find-and-replace-string@5
16+
17+
runs:
18+
using: "composite"
19+
steps:
20+
# get parent directory
21+
- name: Get Repo Name
22+
uses: mad9000/actions-find-and-replace-string@5
23+
id: repoName
24+
with:
25+
source: ${{ github.repository }}
26+
find: "${{ github.repository_owner }}/"
27+
replace: ""
28+
- name: 📁Get Parent Directory Path (!Windows)
29+
uses: mad9000/actions-find-and-replace-string@5
30+
id: parentDirNotWin
31+
with:
32+
source: ${{ github.workspace }}
33+
find: "${{ steps.repoName.outputs.value }}/${{ steps.repoName.outputs.value }}"
34+
replace: ${{ steps.repoName.outputs.value }}
35+
- name: 📁Get Parent Directory Path (Windows)
36+
uses: mad9000/actions-find-and-replace-string@5
37+
id: parentDir
38+
with:
39+
source: ${{ steps.parentDirNotWin.outputs.value }}
40+
find: '${{ steps.repoName.outputs.value }}\${{ steps.repoName.outputs.value }}'
41+
replace: ${{ steps.repoName.outputs.value }}

.github/actions/install/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ inputs:
1515
# actions
1616
#########
1717
18-
# actions/upload-artifact@v4.4.3
18+
# actions/upload-artifact@v4.5.0
1919

2020
runs:
2121
using: "composite"
@@ -41,7 +41,7 @@ runs:
4141
cat ./resources/user/meta/manifests/pipline.txt
4242
# upload pipline
4343
- name: 🔼Upload PipLine
44-
uses: actions/upload-artifact@v4.4.3
44+
uses: actions/upload-artifact@v4.5.0
4545
with:
4646
name: pipline-${{ inputs.calling-job }}-${{ inputs.os-name }}-py${{ inputs.python-version }}-pil${{ inputs.pillow-version }}
4747
path: ./resources/user/meta/manifests

.github/actions/test/action.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/actions.txt

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
1-
┌--------------------------------------┐
2-
| .\.github\actions\install\action.yml |
1+
┌---------------------------------------------
2+
| .\.github\actions\get-parent-dir\action.yml |
33
├-------------------------------------------------------------------
4-
| actions/setup-python v5.3.0 v5.3.0 |
5-
| actions/upload-artifact v4.4.3 v4.4.3 |
4+
| mad9000/actions-find-and-replace-string 5 5 |
65
└-------------------------------------------------------------------
76

8-
┌-----------------------------------┐
9-
| .\.github\actions\test\action.yml |
7+
┌--------------------------------------
8+
| .\.github\actions\install\action.yml |
109
├-------------------------------------------------------------------
11-
| actions/setup-node v4.1.0 v4.1.0 |
10+
| actions/setup-python v5.3.0 v5.3.0 |
11+
| actions/upload-artifact v4.5.0 v4.5.0 |
1212
└-------------------------------------------------------------------
1313

1414
┌------------------------------┐
1515
| .\.github\workflows\push.yml |
1616
├-------------------------------------------------------------------
17+
| ./.github/actions/get-parent-dir N/A |
1718
| ./.github/actions/install N/A |
18-
| ./.github/actions/test N/A |
19+
| ./.github/workflows/test.yml N/A |
1920
| actions/checkout v4.2.2 v4.2.2 |
21+
| actions/deploy-pages v4.0.5 v4.0.5 |
22+
| actions/download-artifact v4.1.8 v4.1.8 |
2023
| actions/setup-python v5.3.0 v5.3.0 |
24+
| actions/upload-pages-artifact v3.0.1 v3.0.1 |
2125
└-------------------------------------------------------------------
2226

2327
┌---------------------------------┐
@@ -26,3 +30,12 @@
2630
| actions/checkout v4.2.2 v4.2.2 |
2731
| actions/setup-python v5.3.0 v5.3.0 |
2832
└-------------------------------------------------------------------
33+
34+
┌------------------------------┐
35+
| .\.github\workflows\test.yml |
36+
├-------------------------------------------------------------------
37+
| ./.github/actions/install N/A |
38+
| actions/checkout v4.2.2 v4.2.2 |
39+
| actions/setup-node v4.1.0 v4.1.0 |
40+
| actions/setup-python v5.3.0 v5.3.0 |
41+
└-------------------------------------------------------------------

.github/workflows/push.yml

Lines changed: 97 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ on: [push, pull_request]
1919
# ubuntu-latest
2020

2121
jobs:
22-
# Test
23-
test:
22+
# Install, List Actions, Discord Notif
23+
install-list-notif:
2424
name: 🧮
2525
runs-on: ${{ matrix.os-name }}
2626
continue-on-error: True
@@ -47,18 +47,14 @@ jobs:
4747
- name: 💿Call Install
4848
uses: ./.github/actions/install
4949
with:
50-
calling-job: test
50+
calling-job: install-list-notif
5151
os-name: ${{ matrix.os-name }}
5252
python-version: ${{ matrix.python-version }}
5353
# Analyze used GitHub Actions
5454
- name: Analyze used GitHub Actions
5555
shell: bash
5656
run: |
5757
python ./resources/ci/common/list_actions.py
58-
# test
59-
- name: ⏱️Call Test
60-
uses: ./.github/actions/test
61-
6258
# Send Discord Notification to Updates
6359
- name: Build Discord Notification Payload
6460
env:
@@ -69,3 +65,97 @@ jobs:
6965
contains(github.ref, 'stable') ||
7066
contains(github.ref, 'unstable') ||
7167
contains(github.ref, 'castIe')
68+
69+
# Install, Test
70+
install-test:
71+
name: ⏱️
72+
uses: ./.github/workflows/test.yml
73+
secrets:
74+
DOTENV_PRIVATE_KEY_DEV_CI: ${{ secrets.DOTENV_PRIVATE_KEY_DEV_CI }}
75+
76+
# Prepare Pages
77+
pages-prepare:
78+
name: 🌎->📦
79+
runs-on: ${{ matrix.os-name }}
80+
needs: [install-test]
81+
82+
strategy:
83+
matrix:
84+
os-name: [ ubuntu-latest ]
85+
86+
steps:
87+
# checkout commit
88+
- name: ✔️Checkout commit
89+
uses: actions/[email protected]
90+
# get parent dir
91+
- name: 📁Get Parent Directory
92+
id: parentDir
93+
uses: ./.github/actions/get-parent-dir
94+
# Prepare Pages
95+
- name: 🌎->📦Prepare GitHub Pages
96+
shell: bash
97+
run: |
98+
python ./resources/ci/common/prepare_pages.py
99+
# upload pages artifact for later step
100+
- name: 🔼Upload Pages Artifact
101+
id: deployment
102+
uses: actions/[email protected]
103+
with:
104+
name: pages-${{ matrix.os-name }}
105+
path: ${{ steps.parentDir.outputs.parentDir }}/pages
106+
107+
# Deploy Pages
108+
pages-deploy:
109+
name: 🌎->🚀
110+
runs-on: ${{ matrix.os-name }}
111+
needs: [pages-prepare]
112+
113+
strategy:
114+
matrix:
115+
os-name: [ ubuntu-latest ]
116+
117+
permissions:
118+
pages: write
119+
id-token: write
120+
121+
environment:
122+
name: github-pages
123+
url: ${{ steps.deployment.outputs.page_url }}
124+
125+
steps:
126+
# checkout commit
127+
- name: ✔️Checkout commit
128+
uses: actions/[email protected]
129+
# download pages artifact
130+
- name: 🔽Download Pages Artifact
131+
uses: actions/[email protected]
132+
with:
133+
name: pages-${{ matrix.os-name }}
134+
path: ./
135+
# extract pages artifact
136+
- name: 📂Extract Pages Artifact
137+
shell: bash
138+
run: |
139+
tar xvf artifact.tar
140+
rm artifact.tar
141+
# Prepare Differences
142+
- name: 📝Prepare Differences
143+
shell: bash
144+
run: |
145+
git add .
146+
# List Differences
147+
- name: ➖List Differences
148+
shell: bash
149+
run: |
150+
git diff --name-status --cached
151+
# List commit message
152+
- name: 📝List Commit Message
153+
shell: bash
154+
run: |
155+
cat commit.txt
156+
# Push to GH-Pages
157+
- name: 🚀Push to GH-Pages
158+
uses: actions/[email protected]
159+
with:
160+
artifact-name: pages-${{ matrix.os-name }}
161+
if: contains(github.ref, 'main')

0 commit comments

Comments
 (0)