diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index de73f6e..e2d9f14 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -2,7 +2,28 @@ name: Build and run unit tests on: [push] jobs: + build: + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: ["3.10"] + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Prep + run: pip3 install build + - name: Build + run: python3 -m build + test: + needs: [build] runs-on: ubuntu-latest strategy: max-parallel: 4 @@ -43,3 +64,31 @@ jobs: run: | FAIL_SRC=0 flake8 src || FAIL_SRC=$? + + release: + needs: [test, flake8] + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + environment: release + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + strategy: + max-parallel: 4 + matrix: + python-version: ["3.10"] + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Prep + run: pip3 install build + - name: Build + run: python3 -m build + - name: Upload package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.gitignore b/.gitignore index 0c29e50..6029492 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ __pycache__ *.egg-info requirements.txt build +dist # Test outputs testresults.xml diff --git a/pyproject.toml b/pyproject.toml index f52dcd0..ac6554d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,13 +6,11 @@ build-backend = "setuptools.build_meta" name = "anms-CAmp" version = "2.0.0" authors = [ - { name="Brian Sipos", email="brian.sipos@jhuapl.edu" }, - { name="David Linko", email="david.linko@jhuapl.edu" }, - { name="Minh Nguyen", email="minh.nguyen@jhuapl.edu" }, + { name="JHU/APL", email="dtnma-support@jhuapl.edu" }, ] description = "C code generator for the Asychronous Management Protocol" readme = "README.md" -license = { file="LICENSE" } +license = { text="Apache-2.0" } requires-python = ">=3.7" classifiers = [ "Development Status :: 5 - Production/Stable",