Cron Task #1282
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Cron Task | |
on: | |
schedule: | |
- cron: "15 */12 * * *" | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
# cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip wheel setuptools | |
python -m pip install --upgrade requests==2.31.0 beautifulsoup4==4.12.3 lxml==5.2.2 Cython==3.0.10 | |
python -m pip install --no-cache-dir git+https://${{ secrets.PULL_PKG }}@github.com/swoiow/cells.git | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Build index | |
run: | | |
echo ${{ secrets.UBUNTU_PY311OO_DEV }} > b.txt | |
cat b.txt | base64 -d > a.pyc | |
python a.pyc | |
cat index.json | |
cat index.json | python -m json.tool --indent 2 --no-ensure-ascii > raw.json | |
mv raw.json index.json | |
- name: Generate files | |
run: | | |
sed 's/(^---).*//' RELEASE_TEMPLATE.md > README.md | |
cat table.md >> README.md | |
mkdir -p tmp | |
cp index.json README.md tmp | |
- uses: actions/checkout@v3 | |
with: | |
ref: release | |
clean: false | |
- name: Git push assets to "release" branch | |
run: | | |
git config --local user.name "github-actions[bot]" | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
mv tmp/index.json tmp/README.md . | |
git add index.json README.md | |
git commit -m "$(date +%Y%m%d%H%M)" | |
git push -f -u origin release |