Publish mullvad-socks-list.txt #3515
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |