release #706
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: release | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
platform: [ ubuntu-latest ] | |
python-version: [ 3.9 ] | |
name: Build | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install libxml2 libxml2-dev | |
\cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'corretto' | |
java-version: '8' | |
- name: Install dependencies | |
run: | | |
git fetch origin main:main | |
git checkout release | |
git checkout main ./ | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run script | |
run: | | |
python main.py | |
sudo cat >.gitignore<<EOF | |
* | |
!.github | |
!.github/** | |
!.gitlab | |
!.gitlab/** | |
!cache | |
!cache/** | |
!CNAME | |
!index.html | |
!README.md | |
!data.json | |
!LISENCE | |
!.gitignore | |
EOF | |
- name: Commit files | |
run: | | |
sudo git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
sudo git config --local user.name "github-actions[bot]" | |
sudo git rm --cached --ignore-unmatch -r -f * | |
sudo git add . | |
sudo git commit -m "Add sync changes" | |
sudo git checkout release | |
sudo git push -f origin release |