Run and publish python program #117
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: Run and publish python program | |
on: | |
schedule: | |
- cron: "0 2 * * *" | |
push: | |
branches: [ master ] | |
jobs: | |
run-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies and init ENV | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
- name: Run main.py | |
run: | | |
python main.py | |
echo $PWD/$(date +'%Y-%m-%d') | |
echo "FILE_PATH=$PWD/$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
- name: Generate Release | |
uses: ncipollo/release-action@v1 | |
with: | |
name: ${{ env.DATE }} IP-for-continent | |
allowUpdates: true | |
tag: ${{ env.DATE }}-IP-for-continent | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: ${{ env.FILE_PATH }}/* | |
body: | | |
这是根据大洲分布IP的IP CIDR块list |