Skip to content

.github/workflows/build.yaml #36

.github/workflows/build.yaml

.github/workflows/build.yaml #36

Workflow file for this run

on:
push:
schedule:
- cron: '0 0 * * 0'
jobs:
publish:
runs-on: ubuntu-latest
name: Build Chrome OS releases database
steps:
- name: download repo
uses: actions/checkout@v4
- name: setup proxy
run: |
set -x
cd /tmp
wget -q "https://github.com/ViRb3/wgcf/releases/download/v2.2.29/wgcf_2.2.29_linux_amd64" -O wgcf
chmod +x wgcf
./wgcf register --accept-tos
./wgcf generate
echo "[Socks5]" >> "wgcf-profile.conf"
echo "BindAddress = 127.0.0.1:40000" >> "wgcf-profile.conf"
wget -q "https://github.com/whyvl/wireproxy/releases/download/v1.0.9/wireproxy_linux_amd64.tar.gz" -O wireproxy_linux_amd64.tar.gz
tar -xf wireproxy_linux_amd64.tar.gz
- name: restore downloads cache
uses: actions/cache/restore@v4
with:
path: downloads
key: downloads-${{ github.ref }}
- name: run build
run: |
set -x
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
(cd /tmp; nohup ./wireproxy -c wgcf-profile.conf &)
export HTTPS_PROXY="socks5h://127.0.0.1:40000"
export HTTP_PROXY="socks5h://127.0.0.1:40000"
python3 main.py
- name: upload database as an artifact
uses: actions/upload-artifact@v4
with:
name: data
path: data/data.json
compression-level: 9
- name: upload downloads as an artifact
uses: actions/upload-artifact@v4
with:
name: downloads
path: downloads/
compression-level: 9
- name: save downloads cache
uses: actions/cache/save@v4
with:
path: downloads
key: downloads-${{ github.ref }}
- name: publish database
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "<>"
cd data
git clone "https://${{ secrets.GH_TOKEN }}@github.com/MercuryWorkshop/chromeos-releases-data" -b main
cd chromeos-releases-data
cp ../data.json ./
git add .
git commit -m "update data.json"
git push origin main
workflow-keepalive:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- uses: liskin/gh-workflow-keepalive@v1