-
Notifications
You must be signed in to change notification settings - Fork 1
119 lines (108 loc) · 3.36 KB
/
clean-caches.yml
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
name: Clean GitHub Actions Cache
on:
schedule:
- cron: "0 * * * *" # Schedule every hour
push:
branches:
- master
workflow_dispatch:
workflow_call:
secrets:
ACCESS_TOKEN:
required: true
jobs:
clean-cache:
if: contains(github.repository, 'php-proxy-hunter')
runs-on: windows-latest
env:
PIP_CACHE_DIR: "${{ github.workspace }}/project/tmp/pip"
NUITKA_CACHE_DIR: "${{ github.workspace }}/project/tmp/nuitka-cache"
NODE_OPTIONS: "--max_old_space_size=4096" #8192 4096 --expose-gc
YARN_ENABLE_IMMUTABLE_INSTALLS: false
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
node_version: 18.x
php_version: 7.4
YARN_CHECKSUM_BEHAVIOR: update
steps:
- uses: actions/checkout@v4
with:
repository: "dimaslanjaka/php-proxy-hunter"
ref: master
token: ${{ secrets.ACCESS_TOKEN }}
lfs: true
- name: Update Submodules
run: |
echo "init submodules"
git submodule init
git submodule foreach "git submodule init"
echo "sync submodules"
git submodule sync
git submodule foreach "git submodule sync"
echo "update submodules"
mkdir -p bin >/dev/null 2>&1
curl -L https://github.com/dimaslanjaka/bin/raw/master/bin/submodule-install > bin/submodule-install
rm -rf .git/modules
bash ./bin/submodule-install
git lfs track "*.rar"
shell: bash
- uses: actions/setup-python@v5
with:
python-version: "3.11"
architecture: "x64"
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Get pip cache dir
id: pip-cache
run: echo "pip_cache_dir=$(pip cache dir)" >> $GITHUB_ENV
- name: Setup Cache
id: cache
uses: actions/cache/restore@v4
with:
path: |
~/.cache/pip
./dist/
./tmp/
src/*.sqlite*
src/*.mmdb
node_modules/
.yarn/caches/
.yarn/*.gz
./venv/
${{ env.pip_cache_dir }}
${{ env.NUITKA_CACHE_DIR }}
*.lock
*.txt
package-lock.json
assets/proxies/
vendor/
${{ env.USERPROFILE }}\AppData\Local\Nuitka\Nuitka\Cache
$HOME/AppData/Local/Nuitka/Nuitka/Cache
config/
.cache/
working.json
key: ${{ runner.os }}-python-${{ hashFiles('.husky/hash.txt') }}
restore-keys: |
${{ runner.os }}-python-${{ hashFiles('.husky/hash.txt') }}
${{ runner.os }}-python-
${{ runner.os }}-nuitka-
${{ runner.os }}-php-
${{ runner.os }}-
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
corepack enable
yarn install
- name: Initialize Github Actions
id: php-github-actions-init
env:
GITHUB_OUTPUT: $GITHUB_OUTPUT
run: |
node github-actions-init.cjs
- name: Clean github actions cache
env:
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
shell: cmd
run: |
call "${{ github.workspace }}/bin/clear-github-actions-cache.cmd"