Skip to content

Commit 4a17f1b

Browse files
author
Peterson
committed
Added GitHub actions automation for CI/CD.
1 parent 7fe405b commit 4a17f1b

File tree

4 files changed

+126
-7
lines changed

4 files changed

+126
-7
lines changed

.github/workflows/build.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Build packages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- 'integration/**'
8+
9+
jobs:
10+
build:
11+
# This section builds the distribution for all versions of Python listed in
12+
# the python-version matrix under strategy to confirm that it builds for
13+
# all of those versions. It then uploads the package built by Python 3.9
14+
# for use in later jobs.
15+
name: Build distribution
16+
runs-on: ubuntu-latest
17+
outputs:
18+
version: ${{ steps.extract_version.outputs.raw_version }}
19+
rc_version: ${{ steps.extract_release_candidate_version.outputs.version }}
20+
strategy:
21+
matrix:
22+
python-version: [3.9, 3.10, 3.11, 3.12, 3.13, 3.14]
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.x"
29+
- name: Extract version number from __about__.py
30+
shell: bash
31+
run: echo "raw_version=`sed -n 's/__version__ = \"\(.*\)\"/\1/p' < sarpy_apps/__about__.py`" >> $GITHUB_OUTPUT
32+
id: extract_version
33+
- name: Set version number for release candidate
34+
shell: bash
35+
if: contains(github.ref, 'refs/heads/integration/')
36+
run: |
37+
echo ${{ steps.extract_version.outputs.raw_version }}
38+
rc_version=${{ steps.extract_version.outputs.raw_version }}rc0
39+
sed -i -e "s/__version__ = \"${{ steps.extract_version.outputs.raw_version }}/__version__ = \"$rc_version/g" sarpy_apps/__about__.py
40+
echo "version=$rc_version" >> $GITHUB_OUTPUT
41+
id: extract_release_candidate_version
42+
- name: Install pypa/build
43+
run: >-
44+
python3 -m
45+
pip install
46+
build
47+
--user
48+
- name: Build a binary wheel and a source tarball
49+
run: python3 -m build
50+
- name: Store the distribution packages
51+
if: matrix.python-version == 3.9
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: python-package-distributions
55+
path: dist/
56+
# This job creates a GitHub release and uploads the package contents created
57+
# in the build job to the release.
58+
release:
59+
name: Create release
60+
needs: build
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v4
64+
- name: Extract version number from __about__.py
65+
shell: bash
66+
run: |
67+
if "${{endswith(github.ref, 'master')}}"
68+
then
69+
echo "version=${{ needs.build.outputs.version }}" >> $GITHUB_OUTPUT
70+
else
71+
echo "version=${{ needs.build.outputs.rc_version }}" >> $GITHUB_OUTPUT
72+
fi
73+
id: extract_version
74+
- name: Create a release
75+
uses: comnoco/[email protected]
76+
id: create_release
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
79+
with:
80+
tag_name: v${{ steps.extract_version.outputs.version }}
81+
release_name: Version ${{ steps.extract_version.outputs.version }}
82+
body: |
83+
Changes in this Release
84+
- Added the CphdVectorTFR class (Create a tool to visualize a CPHD
85+
vector's time-frequency representation)
86+
- Added release automation
87+
draft: false
88+
prerelease: false
89+
- name: Download all the dists
90+
uses: actions/download-artifact@v4
91+
with:
92+
name: python-package-distributions
93+
path: dist
94+
- name: Upload package
95+
uses: softprops/action-gh-release@v2
96+
with:
97+
tag_name: ${{ steps.extract_version.outputs.version }}
98+
draft: false
99+
prerelease: false
100+
files: dist/*
101+
# publish-to-pypi:
102+
# name: Publish to PyPI
103+
# needs: release
104+
# runs-on: ubuntu-latest
105+
# environment:
106+
# name: development
107+
# permissions:
108+
# id-token: write
109+
# steps:
110+
# - name: Download all the dists
111+
# uses: actions/download-artifact@v4
112+
# with:
113+
# name: python-package-distributions
114+
# path: dist
115+
# - name: Publish distribution to PyPI
116+
# uses: pypa/gh-action-pypi-publish@release/v1
117+
# with:
118+
# repository-url: https://pypi.org/legacy/

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## [1.1.24]
44
### Added
55
- Time-frequency visualization to `cphd_validation_tool`
6+
- Delivery automation
67
### Fixed
78
- Make `pulse_explorer` compatible with sarpy 1.3.0 changes
89

sarpy_apps/__about__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
'__title__', '__summary__',
2727
'__license__', '__copyright__']
2828

29-
__version__ = "1.1.23"
29+
__version__ = "1.1.24"
3030

3131
__classification__ = "UNCLASSIFIED" # This should be set appropriately in any high-side version
3232
__author__ = "National Geospatial-Intelligence Agency"
3333
__url__ = "https://github.com/ngageoint/sarpy_apps"
34-
__email__ = "Wade.C.Schwartzkopf@nga.mil"
34+
__email__ = "richard.m.naething@nga.mil"
3535

3636

3737
__title__ = "sarpy_apps"

setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
'Development Status :: 4 - Beta',
3838
'Intended Audience :: Developers',
3939
'License :: OSI Approved :: MIT License',
40-
'Programming Language :: Python :: 3',
41-
'Programming Language :: Python :: 3.6',
42-
'Programming Language :: Python :: 3.7',
43-
'Programming Language :: Python :: 3.8',
4440
'Programming Language :: Python :: 3.9',
45-
'Programming Language :: Python :: 3.10'
41+
'Programming Language :: Python :: 3.10',
42+
'Programming Language :: Python :: 3.11',
43+
'Programming Language :: Python :: 3.12',
44+
'Programming Language :: Python :: 3.13',
45+
'Programming Language :: Python :: 3.14'
4646
],
4747
platforms=['any'],
4848
license='MIT'

0 commit comments

Comments
 (0)