Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/1.0.0 #159

Merged
merged 51 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
25388af
restrict sorting to first entry of tuple
danielfromearth Mar 25, 2024
2cc1cde
add new test (without data files) for stitching together subsetted ou…
danielfromearth Mar 25, 2024
0494d8f
use dim not var, and check both original and flattened key in test as…
danielfromearth Mar 25, 2024
bdc81ba
autoupdate pre-commmit
danielfromearth Mar 25, 2024
9446f44
update CHANGELOG.md
danielfromearth Mar 25, 2024
0ea81f3
Bump ruff from 0.3.3 to 0.3.4
dependabot[bot] Mar 25, 2024
d6ae7ad
Merge pull request #137 from danielfromearth/dependabot/pip/develop/r…
danielfromearth Mar 26, 2024
ece2b15
Merge pull request #136 from danielfromearth/feature/issue-135-fix-co…
danielfromearth Mar 28, 2024
d61102a
Bump ruff from 0.3.4 to 0.3.5
dependabot[bot] Apr 1, 2024
5ec5da0
Merge pull request #143 from danielfromearth/dependabot/pip/develop/r…
danielfromearth Apr 8, 2024
cf504a5
Bump dask from 2024.3.1 to 2024.4.1
dependabot[bot] Apr 8, 2024
890be8e
Merge pull request #144 from danielfromearth/dependabot/pip/develop/d…
danielfromearth Apr 8, 2024
de1cfca
Bump xarray from 2024.2.0 to 2024.3.0
dependabot[bot] Apr 8, 2024
7de37b9
Create LICENSE
danielfromearth Apr 9, 2024
6568068
Merge pull request #141 from danielfromearth/dependabot/pip/develop/x…
danielfromearth Apr 9, 2024
2cbb1dd
Add SRA number to end of README.md
danielfromearth Apr 9, 2024
0118cf4
Merge pull request #146 from nasa/feature/issue-145-add-license
danielfromearth Apr 9, 2024
0ffcb89
Bump version to 1.0.0
danielfromearth Apr 10, 2024
a6f507b
add pytest-cov as dev dependency
danielfromearth Apr 10, 2024
b592cb7
modify test running workflow to use pytest-cov and codecov
danielfromearth Apr 10, 2024
ea8551c
Merge pull request #150 from nasa/feature/issue-149-add-code-coverage
danielfromearth Apr 10, 2024
6fdf273
add codecove badge to readme
danielfromearth Apr 10, 2024
6ca10b6
Merge pull request #151 from nasa/feature/issue-149-add-code-coverage
danielfromearth Apr 10, 2024
195711f
autoupdate pre-commit
danielfromearth Apr 10, 2024
e581123
rename group_handling to be dataset_and_group_handling.py
danielfromearth Apr 10, 2024
9cda07f
move and format with black
danielfromearth Apr 10, 2024
81663a0
move functions to dataset_and_group_handling.py module
danielfromearth Apr 10, 2024
ec39535
modify empty checking logic, and add unit test with toy and sample da…
danielfromearth Apr 10, 2024
70db049
update docstring for file empty check
danielfromearth Apr 10, 2024
c2d4dd2
fix path to test module
danielfromearth Apr 10, 2024
d76d6f2
change not-empty function test to use toy data created at runtime
danielfromearth Apr 10, 2024
9d80205
update CHANGELOG.md
danielfromearth Apr 10, 2024
cf8ebe8
Merge pull request #152 from nasa/feature/issue-147-empty-detection
danielfromearth Apr 11, 2024
5c95b12
Merge pull request #155 from nasa/main
danielfromearth Apr 15, 2024
c3fec97
add version bumping and tag steps
danielfromearth Apr 15, 2024
d5b6554
add snyk scanning steps to build pipeline
danielfromearth Apr 15, 2024
e107436
build docker image on main
danielfromearth Apr 15, 2024
ef6a3a4
update CHANGELOG.md
danielfromearth Apr 15, 2024
5b42d4a
add release-created.yml
danielfromearth Apr 15, 2024
fca8496
Merge pull request #157 from nasa/feature/issue-156-update-ci
danielfromearth Apr 15, 2024
6fea794
/version 1.0.1a0
Apr 15, 2024
d92531b
add pypi publishing steps to build-pipeline.yml
danielfromearth Apr 15, 2024
27568fa
update CHANGELOG.md
danielfromearth Apr 15, 2024
b52577d
Merge pull request #158 from nasa/feature/issue-156-update-ci
danielfromearth Apr 15, 2024
565b9ca
/version 1.0.1a1
Apr 15, 2024
5530ef2
/version 1.0.0rc1
Apr 15, 2024
a68101d
update version header in CHANGELOG.md
danielfromearth Apr 15, 2024
34dab41
/version 1.0.0rc2
Apr 15, 2024
180e698
Bump ruff from 0.3.5 to 0.3.7
dependabot[bot] Apr 15, 2024
74b323e
Merge pull request #161 from nasa/dependabot/pip/develop/ruff-0.3.7
danielfromearth Apr 16, 2024
8aa10ce
/version 1.0.0rc3
Apr 16, 2024
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
190 changes: 190 additions & 0 deletions .github/workflows/build-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
# This is the main build pipeline that verifies and publishes the software
name: Build

# Controls when the workflow will run
on:
# Triggers the workflow on push events
push:
branches: [ develop, release/**, main, feature/**, issue/**, issues/** ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
POETRY_VERSION: "1.3.2"
PYTHON_VERSION: "3.10"
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
# The first job in the workflow confirms that the software's own tests pass.
run_tests:
uses: ./.github/workflows/run_tests.yml

# Second job in the workflow verifies the software
build:
needs: run_tests
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Retrieve repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
uses: abatilo/actions-poetry@v3.0.0
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Get version
id: get-version
run: |
echo "current_version=$(poetry version | awk '{print $2}')" >> $GITHUB_OUTPUT
echo "pyproject_name=$(poetry version | awk '{print $1}')" >> $GITHUB_ENV

# Bumps the version, based on which branch is the target.
- name: Bump pre-alpha version
# If triggered by push to a feature branch
if: |
${{ startsWith(github.ref, 'refs/heads/issue') }} ||
${{ startsWith(github.ref, 'refs/heads/dependabot/') }} ||
${{ startsWith(github.ref, 'refs/heads/feature/') }}
run: |
new_ver="${{ steps.get-version.outputs.current_version }}+$(git rev-parse --short ${GITHUB_SHA})"
poetry version $new_ver
echo "software_version=$(poetry version | awk '{print $2}')" >> $GITHUB_ENV
- name: Bump alpha version
# If triggered by push to the develop branch
if: ${{ github.ref == 'refs/heads/develop' }}
run: |
poetry version prerelease
echo "software_version=$(poetry version | awk '{print $2}')" >> $GITHUB_ENV
echo "venue=sit" >> $GITHUB_ENV
- name: Bump rc version
# If triggered by push to a release branch
if: ${{ startsWith(github.ref, 'refs/heads/release/') }}
env:
# True if the version already has a 'rc' pre-release identifier
BUMP_RC: ${{ contains(steps.get-version.outputs.current_version, 'rc') }}
run: |
if [ "$BUMP_RC" = true ]; then
poetry version prerelease
else
poetry version ${GITHUB_REF#refs/heads/release/}rc1
fi
echo "software_version=$(poetry version | awk '{print $2}')" >> $GITHUB_ENV
echo "venue=uat" >> $GITHUB_ENV
- name: Release version
# If triggered by push to the main branch
if: ${{ startsWith(github.ref, 'refs/heads/main') }}
env:
CURRENT_VERSION: ${{ steps.get-version.outputs.current_version }}
# Remove rc* from the end of version string
# The ${string%%substring} syntax below deletes the longest match of $substring from back of $string.
run: |
poetry version ${CURRENT_VERSION%%rc*}
echo "software_version=$(poetry version | awk '{print $2}')" >> $GITHUB_ENV
echo "venue=ops" >> $GITHUB_ENV

- name: Run Snyk as a blocking step
uses: snyk/actions/python-3.10@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: test
args: >
--org=${{ secrets.SNYK_ORG_ID }}
--project-name=${{ github.repository }}
--severity-threshold=high
--fail-on=all
- name: Run Snyk on Python
uses: snyk/actions/python-3.10@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: monitor
args: >
--org=${{ secrets.SNYK_ORG_ID }}
--project-name=${{ github.repository }}

- name: Commit Version Bump
# If building the `develop`, a `release` branch, or `main`,
# then we commit the version bump back to the repo.
if: |
github.ref == 'refs/heads/develop' ||
github.ref == 'refs/heads/main' ||
startsWith(github.ref, 'refs/heads/release')
run: |
git config --global user.name 'stitchee bot'
git config --global user.email 'stitchee@noreply.github.com'
git commit -am "/version ${{ env.software_version }}"
git push

# Builds and pushes the package to the Python Package Index (PyPI)
- name: Build Python Artifact
run: |
poetry build
- uses: actions/upload-artifact@v4
with:
name: python-artifact
path: dist/*
- name: Publish to test.pypi.org
id: pypi-test-publish
if: |
github.ref == 'refs/heads/develop' ||
startsWith(github.ref, 'refs/heads/release')
env:
POETRY_PYPI_TOKEN_TESTPYPI: ${{secrets.PYPI_TOKEN_TESTPYPI}}
run: |
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry publish -r testpypi
- name: Publish to pypi.org
if: ${{ github.ref == 'refs/heads/main' }}
id: pypi-publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{secrets.PYPI_TOKEN_PYPI}}
run: |
poetry publish

# Builds and pushes a Docker image
- name: Log in to the Container registry
if: ${{ !startsWith(github.ref, 'refs/heads/main/') }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
if: ${{ !startsWith(github.ref, 'refs/heads/main/') }}
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,pattern={{version}},value=${{ env.software_version }}
type=raw,value=${{ env.venue }}
- name: Build and push Docker image
if: ${{ !startsWith(github.ref, 'refs/heads/main/') }}
id: docker-push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
build-args: |
SOURCE=${{env.pyproject_name}}[harmony]==${{ env.software_version }}
push: true
pull: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Push Tag
if: |
github.ref == 'refs/heads/develop' ||
github.ref == 'refs/heads/main' ||
startsWith(github.ref, 'refs/heads/release')
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git tag -a "${{ env.software_version }}" -m "Version ${{ env.software_version }}"
git push origin "${{ env.software_version }}"
164 changes: 0 additions & 164 deletions .github/workflows/push.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/release-created.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release Branch Created

# Run whenever a ref is created https://docs.github.com/en/actions/reference/events-that-trigger-workflows#create
on:
create

jobs:
# First job in the workflow builds and verifies the software artifacts
bump:
name: Bump minor version on develop
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Only run if ref created was a release branch
if:
${{ startsWith(github.ref, 'refs/heads/release/') }}
steps:
# Checks-out the develop branch
- uses: actions/checkout@v4
with:
ref: 'refs/heads/develop'
- uses: actions/setup-python@v5
with:
python-version: 3.10
- name: Install Poetry
uses: abatilo/actions-poetry@v3.0.0
with:
poetry-version: 1.3.2
- name: Bump minor version
run: |
poetry version ${GITHUB_REF#refs/heads/release/}
poetry version preminor
echo "software_version=$(poetry version | awk '{print $2}')" >> $GITHUB_ENV
- name: Commit Version Bump
run: |
git config --global user.name 'stitchee bot'
git config --global user.email 'stitchee@noreply.github.com'
git commit -am "/version ${{ env.software_version }}"
git push
Loading