Skip to content

Commit

Permalink
package-downloads: Store version-aggregated counts
Browse files Browse the repository at this point in the history
  • Loading branch information
mbargull committed Feb 9, 2023
1 parent 90647e4 commit 66b93dc
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 243 deletions.
25 changes: 11 additions & 14 deletions .github/workflows/packages-anaconda-org.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,40 @@ jobs:
export PYTHONPATH="$( pwd )/src"
python -m package_downloads.ntp_time
)"
git fetch --depth=1 origin data:data
last_commit_message="$( git --no-pager log -1 --pretty=%s data )"
set -x
case "${last_commit_message}" in
*"${time}" )
if git ls-remote --exit-code --quiet --tags -- origin "${time}" ; then
echo "skip=1" >> "${GITHUB_OUTPUT}"
;;
* )
else
echo "skip=0" >> "${GITHUB_OUTPUT}"
esac
fi
- if: ${{ github.ref != 'refs/heads/main' || steps.check.outputs.skip == '0' }}
name: Fetch
id: fetch
run: |
set -x
ref="$( git show-ref --head --hash HEAD )"
pip install \
ntplib \
aiohttp requests urllib3 \
pandas
git fetch --depth=1 origin data:data
git checkout --quiet data
git checkout --quiet "${ref}" -- ./src
time="$(
export PYTHONPATH="$( pwd )/src"
mkdir tmp
cd tmp
python -m package_downloads.stats_from_anaconda_org
)"
echo "time=${time}" >> "${GITHUB_OUTPUT}"
- if: ${{ github.ref != 'refs/heads/main' || steps.check.outputs.skip == '0' }}
name: Add changes, commit
run: |
set -x
git config user.name github-actions
git config user.email [email protected]
git checkout data
rm -rf package-downloads
mv tmp/package-downloads ./
rmdir tmp
git add -A ./package-downloads
git rm -rf ./src
git status --short | grep -o ^. | sort | uniq -c
git commit -qm 'Update package download stats, ${{ steps.fetch.outputs.time }}'
git tag '${{ steps.fetch.outputs.time }}'
Expand Down
182 changes: 0 additions & 182 deletions package-downloads.md

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 66b93dc

Please sign in to comment.