Dataset Release #46
This file contains hidden or 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: Dataset Release | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "17 3 * * *" | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: sat-geoip-dataset-release | |
| cancel-in-progress: false | |
| jobs: | |
| build-release: | |
| name: Build and publish dataset | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.24.x" | |
| cache: true | |
| - name: Download reference datasets | |
| run: | | |
| mkdir -p data/reference/geonames data/reference/ourairports | |
| curl -fsSL --retry 3 --max-time 60 https://download.geonames.org/export/dump/countryInfo.txt -o data/reference/geonames/countryInfo.txt | |
| curl -fsSL --retry 3 --max-time 60 https://download.geonames.org/export/dump/admin1CodesASCII.txt -o data/reference/geonames/admin1CodesASCII.txt | |
| curl -fsSL --retry 3 --max-time 120 https://download.geonames.org/export/dump/cities1000.zip -o data/reference/geonames/cities1000.zip | |
| unzip -o data/reference/geonames/cities1000.zip -d data/reference/geonames | |
| rm -f data/reference/geonames/cities1000.zip | |
| curl -fsSL --retry 3 --max-time 120 https://davidmegginson.github.io/ourairports-data/airports.csv -o data/reference/ourairports/airports.csv | |
| - name: Test | |
| run: go test ./... | |
| - name: Build live dataset artifacts | |
| run: go run ./cmd/sat-geoip -format live-release -out outputs | |
| - name: Build GitHub Pages dashboard data | |
| run: go run ./cmd/sat-geoip -format site-data -out site/data -stats outputs/stats.json -records outputs/sat-geoip-prefixes.jsonl -gateways outputs/operator-gateway-reference.csv -reference data/reference | |
| - name: Update README statistics | |
| run: go run ./cmd/sat-geoip -format update-readme-stats -stats outputs/stats.json -readme README.md | |
| - name: Prepare release metadata | |
| id: meta | |
| run: | | |
| tag="dataset-$(date -u +'%Y.%m.%d-%H%M%S')" | |
| echo "tag=${tag}" >> "$GITHUB_OUTPUT" | |
| echo "name=sat-geoip Dataset $(date -u +'%Y-%m-%d %H:%M:%S UTC')" >> "$GITHUB_OUTPUT" | |
| - name: Commit generated dataset files | |
| run: | | |
| set -euo pipefail | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| # The live build can take long enough for main to move. Rebase onto | |
| # the latest branch tip before creating the generated-artifacts commit | |
| # so a normal non-forced push remains possible. | |
| git add README.md site outputs/*.csv outputs/*.jsonl outputs/*.json outputs/*.md outputs/*.mmdb | |
| if git diff --cached --quiet; then | |
| exit 0 | |
| fi | |
| git stash push --include-untracked --message generated-dataset-artifacts -- README.md site outputs | |
| git fetch origin main | |
| git rebase origin/main | |
| git stash pop | |
| git add README.md site outputs/*.csv outputs/*.jsonl outputs/*.json outputs/*.md outputs/*.mmdb | |
| if ! git diff --cached --quiet; then | |
| git commit -m "Update sat-geoip dataset artifacts [skip ci]" | |
| for attempt in 1 2 3; do | |
| if git push; then | |
| exit 0 | |
| fi | |
| git fetch origin main | |
| git rebase origin/main | |
| done | |
| echo "failed to push generated dataset commit after retries" >&2 | |
| exit 1 | |
| fi | |
| - name: Publish GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.meta.outputs.tag }} | |
| name: ${{ steps.meta.outputs.name }} | |
| body_path: outputs/RELEASE_NOTES.md | |
| make_latest: true | |
| files: | | |
| outputs/sat-geoip-prefixes.jsonl | |
| outputs/sat-geoip-prefixes.csv | |
| outputs/satellite-asns.csv | |
| outputs/operator-geofeeds.csv | |
| outputs/operator-gateway-reference.csv | |
| outputs/prefix-changes.jsonl | |
| outputs/prefix-changes.csv | |
| outputs/history-summary.json | |
| outputs/starlink-geoip-vs-bgp.csv | |
| outputs/starlink-pop-mapping.csv | |
| outputs/pops-vs-ptr-mismatch.csv | |
| outputs/stats.json | |
| outputs/RELEASE_NOTES.md | |
| outputs/sat-geoip.mmdb |