-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (55 loc) · 1.63 KB
/
mullvad-socks.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
name: Publish mullvad-socks-list.txt
on:
repository_dispatch:
workflow_dispatch:
push:
schedule:
- cron: 44 */6 * * *
jobs:
run:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Clone and setup repo
run: |
git clone "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" repo
cd repo
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git checkout list
git pull
rm *.txt
echo "TAG_NAME=$(date +"%Y-%m-%dT%H-%M-%S")" >> $GITHUB_ENV
- name: Download and install script dependencies
run: |
wget https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-City.mmdb
pip3 install -r requirements.txt
- name: Generate list
run: |
python3 mullvad-socks-list.py
- name: Push result to "list" branch
run: |
cd repo
git add .
git commit -m "${{ env.TAG_NAME }}"
git push -u origin list
- name: Upload to Releases
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
body: ${{ env.TAG_NAME }}
files: repo/*
- name: Remove old Releases
uses: dev-drprasad/[email protected]
with:
keep_latest: 12
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}