-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 1.79 KB
/
update_allCountries.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Update GeoNames Data
on:
schedule:
- cron: '0 0 * * 0' # Run every Sunday at midnight UTC
workflow_dispatch: # Allow manual triggering
permissions:
contents: write
issues: write
pull-requests: write
jobs:
update-geonames:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install httpx loguru tqdm
- name: Run update script
run: python update_allCountries.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check update status
id: check_update
run: |
UPDATE_STATUS=$(cat update_status.txt)
echo "UPDATE_STATUS=$UPDATE_STATUS" >> $GITHUB_OUTPUT
- name: Read release notes
id: release_notes
run: |
RELEASE_NOTES=$(cat release_notes.txt)
echo "RELEASE_NOTES<<EOF" >> $GITHUB_OUTPUT
echo "$RELEASE_NOTES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Read release title
id: release_title
run: echo "RELEASE_TITLE=$(cat release_title.txt)" >> $GITHUB_OUTPUT
- name: Create Release
if: steps.check_update.outputs.UPDATE_STATUS == 'update'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}-${{ github.run_number }}
name: ${{ steps.release_title.outputs.RELEASE_TITLE }}
body: ${{ steps.release_notes.outputs.RELEASE_NOTES }}
files: allCountries.zip
draft: false
prerelease: false
- name: Upload release notes
uses: actions/upload-artifact@v4
with:
name: release-notes
path: release_notes.txt