File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 88env :
99 SKIP_EXPORT : ' false'
1010 TEMP_DIR : ' /tmp'
11+ YEAR_MONTH : ' 01-9999'
1112
1213permissions :
1314 contents : write
@@ -28,20 +29,18 @@ jobs:
2829 run : |
2930 cd ip_country
3031 export YEAR_MONTH=$(date +%Y-%m)
32+ echo "TEMP_DIR=$(mktemp -d)" >> $GITHUB_ENV
33+ echo "YEAR_MONTH=$YEAR_MONTH" >> $GITHUB_ENV
3134 mkdir -p dbip-data
3235 curl -L -o dbip-data/dbip-country-lite.mmdb.gz "https://download.db-ip.com/free/dbip-country-lite-$YEAR_MONTH.mmdb.gz"
3336 gunzip dbip-data/dbip-country-lite.mmdb.gz
34- echo "TEMP_DIR=$(mktemp -d)" >> $GITHUB_ENV
3537 if [ "$?" -ne "0" ]; then
3638 echo "SKIP_EXPORT=true" >> $GITHUB_ENV
3739 fi
3840
3941 - name : Generate Rust source file
4042 if : ${{ env.SKIP_EXPORT == 'false' }}
4143 run : |
42- set -xv
43- echo $TEMP_DIR
44- pwd
4544 cd ip_country
4645 mkdir -p generated
4746 cargo run < "dbip-data/dbip-country-lite.mmdb" > "$TEMP_DIR"/dbip_country.rs
@@ -53,15 +52,12 @@ jobs:
5352 - name : Commit and push generated file
5453 if : ${{ env.SKIP_EXPORT == 'false' }}
5554 run : |
56- set -xv
5755 git config user.name "github-actions[bot]"
5856 git config user.email "github-actions[bot]@users.noreply.github.com"
5957 git checkout -B generated-source
6058 git rm -rf .
61- ls -la
62- ls -la ip_country
6359 mkdir ip_country/src
6460 mv "${TEMP_DIR}"/dbip_country.rs ip_country/src/dbip_country.rs
6561 git add ip_country/src/dbip_country.rs
66- git commit -m "Update generated dbip_country Rust source file"
62+ git commit -m "Update generated dbip_country ${YEAR_MONTH} Rust source file"
6763 git push origin generated-source --force
You can’t perform that action at this time.
0 commit comments