Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3e8be6c
GH workflow for unit tests
dylannguyen11195 Apr 14, 2025
3a959a5
Remove aws creds and gh token
dylannguyen11195 Apr 14, 2025
8757e72
GHA PyPi release
dylannguyen11195 Apr 16, 2025
965c8a7
v1.14.0-rc1
dylannguyen11195 Apr 16, 2025
88f7b31
Typo
dylannguyen11195 Apr 16, 2025
618aa5d
Update to ubunto-latest
dylannguyen11195 Apr 16, 2025
8fcfc33
Overrides runs-on depending on Python version
dylannguyen11195 Apr 16, 2025
55bc840
Removed Python 3.6 and 3.7
dylannguyen11195 Apr 16, 2025
d12d234
Updated CHANGELOG
dylannguyen11195 Apr 16, 2025
e07a052
Refactor into two workflows
dylannguyen11195 Apr 16, 2025
256a91e
Convert to xml coverage
dylannguyen11195 Apr 16, 2025
5943b52
1.14.0-rc2
dylannguyen11195 Apr 16, 2025
ed89a50
Fix release workflow
dylannguyen11195 Apr 16, 2025
9a83bf4
v1.14.0-rc4
dylannguyen11195 Apr 16, 2025
2af0dd4
Updated documentation for GHA release workflow
dylannguyen11195 Apr 16, 2025
32fdb6a
Revert to production version
dylannguyen11195 Apr 16, 2025
7746701
Remove .travis.yml
dylannguyen11195 Apr 16, 2025
5b88e43
Added unit tests for Python 3.9 -> 3.12
dylannguyen11195 Apr 16, 2025
39267e3
Pin to 3.10.17
dylannguyen11195 Apr 16, 2025
bb3b7c1
Removed Python 3.12
dylannguyen11195 Apr 16, 2025
b7b72d3
Upload artifact for Python 3.8 only
dylannguyen11195 Apr 16, 2025
d80d4dc
Remove Python 3.10 and 3.11
dylannguyen11195 Apr 16, 2025
46c8966
Empty commit
dylannguyen11195 Apr 17, 2025
859a8f3
Added release workflow step to test the distribution
dylannguyen11195 Apr 17, 2025
6092061
v1.14.0-rc5
dylannguyen11195 Apr 17, 2025
2e7db04
Typo
dylannguyen11195 Apr 17, 2025
cdcdbee
1.14.0-rc6
dylannguyen11195 Apr 17, 2025
df3e47f
Revert to 1.13.0
dylannguyen11195 Apr 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/actions/build-package/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'Build Python Package'
description: 'Sets up Python, builds package, and validates it'
inputs:
python-version:
description: 'Python version to use'
required: false
default: '3.8'

runs:
using: "composite"
steps:
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

- name: Upgrade pip and setuptools
shell: bash
run: python -m pip install --upgrade pip setuptools

- name: Install dependencies
shell: bash
run: pip install twine wheel

- name: Setup deployment
shell: bash
run: python setup.py sdist bdist_wheel

- name: Validate deployment
shell: bash
run: twine check dist/*
47 changes: 47 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: release

on:
push:
tags:
- '*'

jobs:
release-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/build-package

- name: Set up a fresh environment and run tests
run: |
python -m venv venv
source venv/bin/activate
pip install dist/*.tar.gz
pip install dist/*.whl
pip install -e .[test]
pytest

release:
runs-on: ubuntu-22.04
needs: release-test

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8

- name: Compare tags
run: |
PKG_VERSION=`grep '__version__' mapbox_tilesets/__init__.py | sed -E "s/^.*['\"](.*)['\"].*$/\1/"`
echo "Checking that package version [v$PKG_VERSION] matches release tag [${{ github.ref_name }}]"
[ "${{ github.ref_type }}" = "tag" ] && [ "${{ github.ref_name }}" = "v$PKG_VERSION" ]

- uses: ./.github/actions/build-package

- name: Run deployment
run:
twine upload dist/* -r pypi -u __token__ -p ${{ secrets.PYPI_PASSWORD }}
53 changes: 53 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Unit test

on:
push:
branches: ["**"]
pull_request:

jobs:
test:
strategy:
matrix:
include:
- python-version: 3.8
os: ubuntu-22.04
- python-version: 3.9
os: ubuntu-22.04

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install "importlib-metadata==4.8.3"
pip install -r requirements.txt -e .[test]

- name: Show Python and pytest versions
run: |
python --version
pytest --version

- name: Run pre-commit checks
run: pre-commit run --all-files

- name: Run tests with coverage
run: pytest --cov --cov-config=.coveragerc --cov-report=xml

- name: List all files in current directory
run: ls -la

- name: Upload coverage to GitHub (optional, internal)
if: matrix.python-version == '3.8'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.xml
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ After which you can add these changes and commit again. Note that failing pre-co

## Release process

Releases to PyPi are handled via TravisCI and GitHub tags. Once changes have been merged to master:
Releases to PyPi are handled via Github Actions and GitHub tags. Once changes have been merged to master:

1. Update the version in mapbox_tilesets/__init__.py
2. Update the changelog
3. Commit changes to **your branch**. For example `git commit -am '0.2.0' && git push origin HEAD`
4. Get a review and merge your changes to master.
5. Get the latest changes locally from master `git checkout master && git pull origin master`
6. Tag on GitHub with `git tag` and push tags. For example `git tag -a v0.2.0 -m 'v0.2.0' && git push --tags`
7. Watch for tag build on travis at https://travis-ci.com/github/mapbox/tilesets-cli/builds
8. Once travis completes successfully, look for the release at https://pypi.org/project/mapbox-tilesets/#history
7. Watch for tag build on Github Actions at https://github.com/mapbox/tilesets-cli/actions
8. Once Github Actions completes successfully, look for the release at https://pypi.org/project/mapbox-tilesets/#history

## Tests

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# tilesets-cli

[![Build Status](https://travis-ci.com/mapbox/tilesets-cli.svg?token=wqR3RcWUEprcQ1ttsgiP&branch=master)](https://travis-ci.com/mapbox/tilesets-cli) [![codecov](https://codecov.io/gh/mapbox/tilesets-cli/branch/master/graph/badge.svg?token=YBTKyc2o3j)](https://codecov.io/gh/mapbox/tilesets-cli)
[![Build Status](https://github.com/mapbox/tilesets-cli/actions/workflows/release.yaml/badge.svg)](https://github.com/mapbox/tilesets-cli/actions/workflows/release.yaml) [![codecov](https://codecov.io/gh/mapbox/tilesets-cli/branch/master/graph/badge.svg?token=YBTKyc2o3j)](https://codecov.io/gh/mapbox/tilesets-cli)

CLI for interacting with and preparing data for the [Mapbox Tiling Service](https://docs.mapbox.com/mapbox-tiling-service/overview/).

Expand Down