forked from Surfboardv2ray/config2Fragment
-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (127 loc) · 3.83 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Run Python Script
on:
push:
branches: [ main ]
workflow_dispatch:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Reset configs directory
run: |
rm -rf configs
mkdir configs
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# If there are any dependencies in your project, add them here.
- name: Make lists
run: |
> uris.txt
python list.py
- name: Upload URIs
uses: actions/upload-artifact@v2
with:
name: uris.txt
path: uris.txt
- name: Check for URI Changes
id: changesRI
run: |
git diff --quiet && echo 'No changes' || echo '::set-output name=changed::true'
- name: Commit and Push URIs if changed
if: steps.changesRI.outputs.changed == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit --allow-empty -m "update URIs"
git pull
git push
- name: Run Script
run: python run.py
- name: Upload JSON files
uses: actions/upload-artifact@v2
with:
name: JSON files
path: /configs/*.json
- name: Commit and Push JSONs
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Add generated JSON file"
git pull
git push
- name: Combine JSON files
run: python export.py
- name: Upload Combined JSON file
uses: actions/upload-artifact@v2
with:
name: Combined JSON file
path: configs/combined.json
- name: Export JSON
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Export JSON"
git pull
git push
- name: Create results directory
run: |
rm -rf results
mkdir results
- name: Run script
run: node java/fragment.js
- name: Upload fragment files
uses: actions/upload-artifact@v2
with:
name: JSON files
path: /results/*.json
- name: Commit and Push Fragment
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Add fragment JSON file"
git push
- name: Combine fragment files
run: python fexport.py
- name: Upload Combined fragment file
uses: actions/upload-artifact@v2
with:
name: Combined fragment file
path: results/combined.json
- name: Export Fragmentation
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Export TLS Fragment"
git pull
git push
- name: Convert base64
run: |
> list64
content=$(cat list.txt | base64 | tr -d '\n')
echo "$content" > list64
- name: Check for base64 Changes
id: changes64
run: |
git diff --quiet && echo 'No changes' || echo '::set-output name=changed::true'
- name: Push Base64
if: steps.changes64.outputs.changed == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit --allow-empty -m "Convert to base64"
git pull
git push