From a56de5117d3330d7668375e7ec5b7b65d7157c71 Mon Sep 17 00:00:00 2001 From: Paul Tunison Date: Wed, 8 Jun 2022 15:23:32 -0400 Subject: [PATCH 1/5] Revise re-use of smqtk-core publish workflow It was the case that the workflow had a parent-org match check. The workflow from smqtk-core would check for the "Kitware" org which is not valid in this case. It was also the case that the shared workflow was using an incorrect base version of python to build the package in (3.6 vs. 3.7). This change creates a new version of this workflow with the appropriate edits that bring into line with the XAITK org and other repository specifics. --- .github/workflows/publish.yml | 58 +++++++++++++++++++++++--- docs/release_notes/pending_release.rst | 5 +++ 2 files changed, 58 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b23da2db..dd4c3bee 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,14 +1,62 @@ -# Re-use the publishing workflow from smqtk-core name: Publish +# Controls when the action will run. on: push: tags: # Only run on tags with official version tag release format (e.g. v1.0.1) - "v[0-9].[0-9]+.[0-9]+" -jobs: - reuse-core-publish: - uses: Kitware/SMQTK-Core/.github/workflows/publish.yml@master + # Allow use of this workflow as a reusable workflow. + # https://docs.github.com/en/actions/learn-github-actions/reusing-workflows + workflow_call: secrets: - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + PYPI_TOKEN: + required: true + +defaults: + run: + shell: bash + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + publish: + runs-on: ubuntu-latest + container: python:3.7 + # This should only be run for tags on the "official" repository org. + if: github.repository_owner == 'XAITK' + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + # Cache local python environment artifacts for the current python version + # and poetry lockfile hash. + - uses: actions/cache@v2 + id: env-cache + with: + # Confirmed that the `.local` directory doesn't exist until the + # `pip install --user` is invoked below, so we can be confident that + # only our python stuff is being captured in this cache (intentional). + path: | + ~/.cache/pypoetry/virtualenvs/ + ~/.local + key: python-3.7-${{ hashFiles('poetry.lock') }} + + - name: Setup Environment + # Using non-relative path for correct behavior when used as a remote + # workflow. + uses: Kitware/SMQTK-Core/.github/actions/python-poetry-setup@master + + - name: Publish + env: + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} + run: | + if [[ -z "$POETRY_PYPI_TOKEN_PYPI" ]] + then + echo "ERROR: Input pypi token was blank. Did you forget to set the appropriate secret?" + exit 1 + fi + echo "Publishing new tag: ${{ github.ref_name }}" + git checkout ${{ github.ref_name }} + poetry publish --build diff --git a/docs/release_notes/pending_release.rst b/docs/release_notes/pending_release.rst index dbc99585..18b98476 100644 --- a/docs/release_notes/pending_release.rst +++ b/docs/release_notes/pending_release.rst @@ -6,3 +6,8 @@ Updates / New Features Fixes ----- + +CI + +* Fix the publish workflow to use appropriate values and version for the + containing org and this repository. From 90363a87dc0d74e7345298f56a691cc51fcc8e7f Mon Sep 17 00:00:00 2001 From: Paul Tunison Date: Wed, 8 Jun 2022 15:31:04 -0400 Subject: [PATCH 2/5] Also run CI when targetting `update-to-v*` branches --- .github/workflows/ci-example-notebooks.yml | 5 +++-- .github/workflows/ci-unittests.yml | 5 +++-- docs/release_notes/pending_release.rst | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-example-notebooks.yml b/.github/workflows/ci-example-notebooks.yml index a4668ec1..44587e52 100644 --- a/.github/workflows/ci-example-notebooks.yml +++ b/.github/workflows/ci-example-notebooks.yml @@ -6,11 +6,12 @@ on: push: branches: - master - - release* + - release pull_request: branches: - master - - release* + - release + - update-to-v* # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/ci-unittests.yml b/.github/workflows/ci-unittests.yml index 2471e553..d2d71135 100644 --- a/.github/workflows/ci-unittests.yml +++ b/.github/workflows/ci-unittests.yml @@ -8,11 +8,12 @@ on: push: branches: - master - - release* + - release pull_request: branches: - master - - release* + - release + - update-to-v* # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/docs/release_notes/pending_release.rst b/docs/release_notes/pending_release.rst index 18b98476..3f6c894f 100644 --- a/docs/release_notes/pending_release.rst +++ b/docs/release_notes/pending_release.rst @@ -11,3 +11,5 @@ CI * Fix the publish workflow to use appropriate values and version for the containing org and this repository. + +* Update CI workflows to also run for ``update-to-v*`` branches. From 6c5c811555f9e0dcab888ccceb43bd6ff3f224ac Mon Sep 17 00:00:00 2001 From: Paul Tunison Date: Wed, 8 Jun 2022 16:04:38 -0400 Subject: [PATCH 3/5] Update version number to 0.6.1 --- docs/release_notes.rst | 1 + docs/release_notes/{pending_release.rst => v0.6.1.rst} | 4 ++-- pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) rename docs/release_notes/{pending_release.rst => v0.6.1.rst} (84%) diff --git a/docs/release_notes.rst b/docs/release_notes.rst index f91f0d2b..b32d6494 100644 --- a/docs/release_notes.rst +++ b/docs/release_notes.rst @@ -10,3 +10,4 @@ Release Notes release_notes/v0.4.0 release_notes/v0.5.0 release_notes/v0.6.0 + release_notes/v0.6.1 diff --git a/docs/release_notes/pending_release.rst b/docs/release_notes/v0.6.1.rst similarity index 84% rename from docs/release_notes/pending_release.rst rename to docs/release_notes/v0.6.1.rst index 3f6c894f..6fd0f03b 100644 --- a/docs/release_notes/pending_release.rst +++ b/docs/release_notes/v0.6.1.rst @@ -1,5 +1,5 @@ -Pending Release Notes -===================== +v0.6.1 +====== Updates / New Features ---------------------- diff --git a/pyproject.toml b/pyproject.toml index 6e255ea0..00d572f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ name = "xaitk_saliency" # REMEMBER: `distutils.version.*Version` types can be used to compare versions # from strings like this. # This package prefers to use the strict numbering standard when possible. -version = "0.6.0" +version = "0.6.1" description = """\ Visual saliency map generation interfaces and baseline implementations \ for explainable AI.""" From 0317c6086340dfdb3efff28b43f6895f8d009ce3 Mon Sep 17 00:00:00 2001 From: Paul Tunison Date: Wed, 8 Jun 2022 16:04:38 -0400 Subject: [PATCH 4/5] Add pending release notes stub --- docs/release_notes/pending_release.rst | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 docs/release_notes/pending_release.rst diff --git a/docs/release_notes/pending_release.rst b/docs/release_notes/pending_release.rst new file mode 100644 index 00000000..dbc99585 --- /dev/null +++ b/docs/release_notes/pending_release.rst @@ -0,0 +1,8 @@ +Pending Release Notes +===================== + +Updates / New Features +---------------------- + +Fixes +----- From 879ad6886afce9a5a884cf804f2742ccedca8aea Mon Sep 17 00:00:00 2001 From: Paul Tunison Date: Wed, 8 Jun 2022 16:11:04 -0400 Subject: [PATCH 5/5] Add a release summary sentence --- docs/release_notes/v0.6.1.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/release_notes/v0.6.1.rst b/docs/release_notes/v0.6.1.rst index 6fd0f03b..5bd3d880 100644 --- a/docs/release_notes/v0.6.1.rst +++ b/docs/release_notes/v0.6.1.rst @@ -1,8 +1,7 @@ v0.6.1 ====== - -Updates / New Features ----------------------- +This patch specializes the release CI workflow for this organization and +repository as opposed to previously relying on the remote workflow. Fixes -----