Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b134039
Test of new deploy release
craigpnnl Aug 29, 2024
7cb4231
Test of new deploy release
craigpnnl Aug 29, 2024
8adf690
Test of new deploy release
craigpnnl Aug 29, 2024
4f6847a
Test update to dev-deployment
craigpnnl Aug 29, 2024
45c69f8
Test update to dev-deployment
craigpnnl Aug 29, 2024
a602502
Test update to dev-deployment
craigpnnl Aug 29, 2024
4792a05
Test update to dev-deployment
craigpnnl Aug 29, 2024
8e1f88c
Test update to dev-deployment
craigpnnl Aug 29, 2024
675fb15
Test update to dev-deployment
craigpnnl Aug 29, 2024
af4ab69
Test update to dev-deployment
craigpnnl Aug 29, 2024
483818e
Test update to dev-deployment
craigpnnl Aug 29, 2024
5bd4a78
Test update to dev-deployment
craigpnnl Aug 29, 2024
ec81c46
Test update to dev-deployment
craigpnnl Aug 29, 2024
b6d81ae
Test update to dev-deployment
craigpnnl Aug 29, 2024
b6476cc
Test update to dev-deployment
craigpnnl Aug 29, 2024
9c6cf7a
Test update to dev-deployment
craigpnnl Aug 29, 2024
bdf2268
Test update to dev-deployment
craigpnnl Aug 29, 2024
4da6193
Test update to dev-deployment
craigpnnl Aug 29, 2024
a4d6eae
Test python job
craigpnnl Aug 29, 2024
9c4331a
Test update to dev-deployment
craigpnnl Aug 29, 2024
50237b4
Test python job
craigpnnl Aug 29, 2024
30e46ec
Test update to dev-deployment
craigpnnl Aug 29, 2024
a8508b1
Test python job
craigpnnl Aug 29, 2024
eb8db92
Test python job
craigpnnl Aug 29, 2024
a7ad0f0
Test update to dev-deployment
craigpnnl Aug 30, 2024
597dd8e
Test python job
craigpnnl Aug 30, 2024
f519f69
Test update to dev-deployment
craigpnnl Aug 30, 2024
3276df2
Test update to dev-deployment
craigpnnl Aug 30, 2024
03a1d98
Test python job
craigpnnl Aug 30, 2024
3f13200
Test update to dev-deployment
craigpnnl Aug 30, 2024
0d1d6b1
Test python job
craigpnnl Aug 30, 2024
25a8e5f
Test python job
craigpnnl Aug 30, 2024
554a007
Test python job
craigpnnl Aug 30, 2024
7976616
Test update to dev-deployment
craigpnnl Aug 30, 2024
51e5287
Test update to dev-deployment
craigpnnl Aug 30, 2024
e6a84f8
Test update to dev-deployment
craigpnnl Aug 30, 2024
b131998
Test update to dev-deployment
craigpnnl Aug 30, 2024
85be6c0
Test python job
craigpnnl Aug 30, 2024
f190f4a
Test update to dev-deployment
craigpnnl Aug 30, 2024
7e1712a
Test python job
craigpnnl Aug 30, 2024
d8354af
Test update to dev-deployment
craigpnnl Aug 30, 2024
20dbe16
Test python job
craigpnnl Aug 30, 2024
f212397
Test update to dev-deployment
craigpnnl Aug 30, 2024
02c3dfa
Test python job
craigpnnl Aug 30, 2024
c74b7c2
Test update to dev-deployment
craigpnnl Aug 30, 2024
f32b6b6
Test python job
craigpnnl Aug 30, 2024
991d50a
Auto Update Version Number
craigpnnl Aug 30, 2024
ace7f82
Test update to dev-deployment
craigpnnl Aug 30, 2024
2b144ed
Test update to dev-deployment
craigpnnl Aug 30, 2024
3bf3871
Test update to dev-deployment
craigpnnl Aug 30, 2024
aedcda6
Test update to dev-deployment
craigpnnl Aug 30, 2024
54f171c
Test update to dev-deployment
craigpnnl Aug 30, 2024
049b095
Update to use pyproject.toml file version.
craigpnnl Aug 30, 2024
6f60e30
Bump version to 2024.8.1
craigpnnl Aug 30, 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
179 changes: 78 additions & 101 deletions .github/workflows/deploy-dev-release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
########################################################################################################
# Deploys a develop release and commits pyproject.toml files with new versions.
#
# When will it run:
# This workflow will only run on push to develop when there is a python file change.
#
# How will it update:
# The script should update based upon the current version in the pyproject.toml file. The workflow
# should run poetry version prerelease to create a new version file. Since this
# repository houses multiple wheels we will be using the ./scripts/runoneach.sh to run this command.
########################################################################################################
name: Deploy Dev Release Artifacts

on:
Expand All @@ -6,11 +17,11 @@ on:
- develop
workflow_dispatch:
inputs:
release-version:
description: "Version number to use. If provided bump-rule will be ignored"
upgrade-version:
description: "Upgrade version number regardless of whether a py file is altered."
required: false
default: ""
type: string
default: false
type: boolean

defaults:
run:
Expand All @@ -31,130 +42,99 @@ jobs:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."

- run: echo "The specified version is ${{ inputs.release-version }}."
- run: |
set -x
set -u
set -e
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
# ref: develop
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
# To compare changes between the current commit and the last pushed remote commit set `since_last_remote_commit: true`. e.g
# with:
# since_last_remote_commit: true
with:
files: |
**.py

- name: Should change version
id: should_update_version
env:
PYTHON_FILES_CHANGED: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
should_update=false
for file in ${PYTHON_FILES_CHANGED}; do
should_update=true
break
done

# handle input required update.
if ${{ inputs.upgrade-version }} ; then
should_update=true
fi

echo "Should update == ${should_update}"
echo "value=${should_update}" >> "$GITHUB_OUTPUT"

- name: Set up Python ${{ env.PYTHON_VERSION }}
if: ${{ steps.should_update_version.outputs.value == 'true' }}
id: setup-python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1.3.3
if: ${{ steps.should_update_version.outputs.value == 'true' }}
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

# #----------------------------------------------
# # load cached venv if cache exists
# #----------------------------------------------
# - name: Load cached venv
# id: cached-poetry-dependencies
# uses: actions/cache@v3
# with:
# path: .venv
# key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

# #----------------------------------------------
# # install dependencies if cache does not exist
# #----------------------------------------------
# - name: Install dependencies
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
# run: poetry install --no-interaction --no-root
- name: Update version and commit pyproject.toml file
if: ${{ steps.should_update_version.outputs.value == 'true' }}
run: |
./scripts/run_on_each.sh poetry version prerelease

git config --global user.name 'Commit Bot'
git config --global user.email '3979063+craig8@users.noreply.github.com'
git add **/pyproject.toml
git commit -m "Auto Update Version Number"
git push

#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install library
run: |
if: ${{ steps.should_update_version.outputs.value == 'true' }}
run: |
./scripts/poetry_install.sh

# git checkout develop
# poetry lock --no-update
# poetry install --no-interaction

# - name: Use given release-version number
# if: inputs.release-version != ''
# run: |
# echo "Using given release version is ${{ inputs.release-version }}"
# poetry version ${{ inputs.release-version }}

# NEW_TAG=v$(poetry version --short)

# # we want to be able to use the variable in later
# # steps we set a NEW_TAG environmental variable
# echo "NEW_TAG=$(echo ${NEW_TAG})" >> $GITHUB_ENV
# # we don't want to update pyproject.toml yet. don't want this change to create merge conflict.
# # we don't really persist right version in pyproject.toml to figure out the next version. we use git tags.
# git restore pyproject.toml

#----------------------------------------------
# bump version number for patch
#----------------------------------------------
- name: Bump Version
run: |
# current_tag is the last tagged release in the repository. From there
# we need to remove the v from the beginning of the tag.
# echo "Bump rule is ${{ inputs.bump-rule }}"
# echo "Given release version is ${{ inputs.release-version }}"
# dt=$(date +%Y.%-m.0)
# if ! $(git tag -l "v*" = ''); then
# # uses -V which is version sort to keep it monotonically increasing.
# current_tag=$(git tag -l "v*" | grep --invert-match '-' | sort --reverse -V | sed -n 1p)
# echo "current git tag is ${current_tag}"
# current_tag=${current_tag#?}
# if [[ "$current_tag" < "$dt" ]]; then
# current_tag=$dt
# fi
# # current_tag is now the version we want to set our poetry version so
# # that we can bump the version
# ./scripts/run_on_each.sh poetry version ${current_tag}
# ./scripts/run_on_each.sh poetry version prerelease

# # poetry version ${current_tag}
# # poetry version prerelease --no-interaction

# else
# # very first release. start with inputs.release-version

# echo "First release. Setting tag as 0.1.0rc0"
# current_tag=$(date +%Y.%-m.1)
# ./scripts/run_on_each.sh poetry version ${current_tag}

# # poetry version ${current_tag}
# fi
version=$(poetry version --short)
./scripts/run_on_each.sh poetry version ${version}

NEW_TAG=v$(poetry version --short)

# Finally because we want to be able to use the variable in later
# steps we set a NEW_TAG environmental variable
echo "NEW_TAG=$(echo ${NEW_TAG})" >> $GITHUB_ENV

- name: Create build artifacts
id: version
if: ${{ steps.should_update_version.outputs.value == 'true' }}
run: |
set -x
set -u
set -e

# set the right version in pyproject.toml before build and publish
./scripts/poetry_build.sh

echo "value=v$(poetry version --short)" >> "$GITHUB_OUTPUT"

# TODO: Check for pipy token and only release to github if we have it.

- name: Push artifacts to github
env:
TAG: ${{ steps.version.outputs.value }}
if: ${{ steps.should_update_version.outputs.value == 'true' }}
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*.gz,dist/*.whl"
Expand All @@ -163,17 +143,14 @@ jobs:
commit: ${{ github.ref }}
# check bump-rule and set accordingly
prerelease: true
tag: ${{ env.NEW_TAG }}
tag: ${{ env.TAG }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to pypi
id: publish-to-pypi
if: github.repository_owner == 'GRIDAPPSD' || github.repository_owner == 'PNNL-CIM-Tools'
if: ${{ steps.should_update_version.outputs.value == 'true' }}
run: |
set -x
set -u
set -e


# This is needed, because the poetry publish will fail at the top level of the project
# so ./scripts/run_on_each.sh fails for that.
echo "POETRY_PUBLISH_OPTIONS=''" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion gridappsd-field-bus-lib/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gridappsd-field-bus"
version = "2023.12.2a0"
version = "2024.8.1a0"
description = "GridAPPS-D Field Bus Implementation"
authors = [
"C. Allwardt <3979063+craig8@users.noreply.github.com>",
Expand Down
6 changes: 6 additions & 0 deletions gridappsd-python-lib/gridappsd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@
from gridappsd.difference_builder import DifferenceBuilder
from gridappsd.app_registration import ApplicationController
import gridappsd.json_extension as json






2 changes: 1 addition & 1 deletion gridappsd-python-lib/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gridappsd-python"
version = "2023.12.2a0"
version = "2024.8.1a0"
description = "A GridAPPS-D Python Adapter"
authors = [
"C. Allwardt <3979063+craig8@users.noreply.github.com>",
Expand Down