Skip to content

Commit

Permalink
Merge branch 'release/24.10.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
davedittrich committed Oct 4, 2024
2 parents e99bad3 + a53ed24 commit 960e2ba
Show file tree
Hide file tree
Showing 12 changed files with 219 additions and 231 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# .github/workflows/build.yml
name: Build

on:
workflow_run:
workflows: ["Test"]
types:
- completed

jobs:
build:
runs-on: ubuntu-22.04
env:
PY_COLORS: 1
PYTHON_VERSION: '3.12.6'
steps:
- name: Dump select GitHub event context
run: |
echo "github.ref=${{ github.ref }}"
echo "github.event.head_commit=$HEAD_COMMIT"
env:
HEAD_COMMIT: ${{ toJson(github.event.head_commit) }}

- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{env.PYTHON_VERSION}}

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.3
# Get from poetry.toml
# virtualenvs-create: false
# prefer-active-python: true

- name: Install poetry dependencies
run: poetry install --no-root --with=dev --with=test

- name: Add Dynamic Versioning Plugin
run: |
poetry self add poetry-dynamic-versioning[plugin]
- name: Update the version
run: |
poetry dynamic-versioning
echo "VERSION=$(poetry version --short)"
- name: Build artifacts
run: make twine-check

- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: dist-files
path: dist/*
44 changes: 44 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# .github/workflows/publish.yml
name: Publish after Build

on:
workflow_run:
workflows: ["Build"]
types:
- completed

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-22.04
env:
PY_COLORS: 1

steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: dist-files
path: ./dist

# [1-publish-workflow]
- name: Publish release candidate artifacts to TestPyPI
if: contains(github.ref, 'rc') == true
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository_url: https://test.pypi.org/legacy/
user: __token__
password: ${{ secrets.PSEC_TEST_PYPI_PASSWORD }}
packages-dir: ./dist
verify-metadata: false

- name: Publish tagged artifacts to PyPI
if: contains(github.ref, 'rc') == false
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PSEC_PYPI_PASSWORD }}
packages-dir: ./dist
verify-metadata: false
# ![1-publish-workflow]

165 changes: 0 additions & 165 deletions .github/workflows/test-build-publish.yml

This file was deleted.

70 changes: 70 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# .github/workflows/test.yml
name: Test

on:
push:
branches:
- main
- develop
- 'feature/*'
- 'hotfix/*'
pull_request:

jobs:
test:
runs-on: ubuntu-22.04
env:
PY_COLORS: 1
TOX_PARALLEL_NO_SPINNER: 1
PYTHON_VERSION: '3.12.6'

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{env.PYTHON_VERSION}}

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
python-version: ${{env.PYTHON_VERSION}}
auto-update-conda: true

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.3
# Get from poetry.toml
# virtualenvs-create: false
# prefer-active-python: true

- name: Install poetry dependencies
run: poetry install --no-root --with=dev --with=test

- name: Install remaining dependencies
run: |
conda config --set always_yes yes --set changeps1 no
make bats-libraries
# Useful for debugging any issues with conda
conda info -a
- name: Add Dynamic Versioning Plugin
run: |
poetry self add poetry-dynamic-versioning[plugin]
- name: Update the version
run: |
poetry dynamic-versioning
echo "VERSION=$(poetry version --short)"
# [1-test-workflow]
- name: Run tests
run: make test
# ![1-test-workflow]

5 changes: 3 additions & 2 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ History
.. Fixed for any bug fixes.
.. Security in case of vulnerabilities.
24.10.3 (2024-10-03)
24.10.4 (2024-10-04)
~~~~~~~~~~~~~~~~~~~~

Changed
^^^^^^^

- Now using Poetry for package management and installation.

- Refactored GitHub Actions workflows.
- (Versions 24.10.0 - 24.10.3 were fix attempts.)

23.4.2 (2023-04-20)
~~~~~~~~~~~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Python command line app for managing groups of secrets (passwords, API keys, etc
other project variables. Reduces security risks from things like weak default passwords,
secrets stored in files in the source code repository directory.

Version: 24.10.3
Version: 24.10.4

* Free software: `Apache 2.0 License <https://www.apache.org/licenses/LICENSE-2.0>`_
* Documentation: https://python_secrets.readthedocs.org.
Expand Down Expand Up @@ -1212,7 +1212,7 @@ Decrypted, it looks like this:
myapp_app_password=brunt.outclass.alike.turbine
--
Sent using psec version 24.10.3
Sent using psec version 24.10.4
https://pypi.org/project/python-secrets/
https://github.com/davedittrich/python_secrets
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24.10.3
24.10.4
Loading

0 comments on commit 960e2ba

Please sign in to comment.