diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 275262d..0eefbbd 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,11 +18,13 @@ jobs: uses: actions/setup-python@v7 with: python-version: "3.13" + - name: install dependencies run: | python3 -m venv venv . venv/bin/activate pip install .[test] + - name: run flake8 run: | . venv/bin/activate diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..97065e4 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +name: Publish + +on: + push: + branches: + - "master" + +jobs: + pypi: + if: startsWith(github.event.head_commit.message, 'release:') + runs-on: ubuntu-latest + environment: pypi + + permissions: + id-token: write # OIDC trusted publishing + contents: read + + steps: + - uses: actions/checkout@v7 + - name: Set up Python + uses: actions/setup-python@v7 + with: + python-version: "3.13" + + - name: build package + run: | + python3 -m pip install build + python3 -m build + + - name: publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ba2b841..dc7d6ca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,16 +22,19 @@ jobs: uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} + - name: install dependencies run: | python3 -m venv venv . venv/bin/activate pip install .[test] + - name: run tests run: | . venv/bin/activate mkdir test-results pytest -v -s --junitxml=test-reports/junit.xml --cov=crypto --cov-config=.coveragerc --cov-report xml + - name: Codecov uses: codecov/codecov-action@v7 with: diff --git a/README.md b/README.md index b8d4c70..bf8843b 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,16 @@ If you have any questions, requests or ideas open an issue or ask us in #develop You can find installation instructions and detailed instructions on how to use this package at the [dedicated documentation site](https://ark.dev/docs/sdk/python/crypto/intro). +## Releases + +Releases are published to [PyPI](https://pypi.org/project/arkecosystem-crypto/) by a GitHub action that runs when a commit prefixed with `release:` lands on `master`. + +1. Update `version` in `setup.py`, e.g. `version='2.1.0'`. +2. Move the `Unreleased` entries in `CHANGELOG.md` under a heading for the new version, e.g. `## 2.1.0 - 2026-12-03`. +3. Open a PR into `master` titled with the version, e.g. `release: 2.1.0`, and make sure the merge commit message starts with `release:`. + +PyPI does not accept a version that has already been published, so the release fails if the version has not been bumped. + ## Security If you discover a security vulnerability within this package, please send an e-mail to security@ark.io. All security vulnerabilities will be promptly addressed.