Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Testing automatic tagging #1

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
strategy:
matrix:
python-version: ['3.9']
outputs:
version: ${{ steps.get_version.outputs.version }}

steps:
- uses: actions/checkout@v4
Expand All @@ -26,6 +28,16 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

# Get the version from pyproject.toml
- name: Install toml package
run: pip install toml
- name: Get version from pyproject.toml
id: get_version
run: |
VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['tool']['poetry']['version'])")
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Install dependencies
run: |
python -m pip install poetry
Expand Down
36 changes: 27 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,27 @@ jobs:
build-and-test:
uses: ./.github/workflows/build-and-test.yml

create-tag:
name: Create Git Tag
needs: build-and-test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create Git Tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ needs.build-and-test.outputs.version }}
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git tag "v${VERSION}"
git push origin "v${VERSION}"

publish-to-pypi:
name: Publish to PyPI
needs:
- build-and-test
needs: [build-and-test, create-tag]
runs-on: ubuntu-latest
environment:
name: pypi
Expand All @@ -35,11 +51,8 @@ jobs:


github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
needs:
- build-and-test
name: Sign distribution and create GitHub release
needs: [build-and-test, create-tag]
runs-on: ubuntu-latest

permissions:
Expand All @@ -52,27 +65,32 @@ jobs:
with:
name: build-artifacts
path: dist/

- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl

- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
VERSION: ${{ needs.build-and-test.outputs.version }}
run: >-
gh release create
'${{ github.ref_name }}'
"v${VERSION}"
--repo '${{ github.repository }}'
--notes ""

- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
VERSION: ${{ needs.build-and-test.outputs.version }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
"v${VERSION}" dist/**
--repo '${{ github.repository }}'
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "paradigma"
version = "0.1.2"
version = "0.1.3"
description = "Digital Biomarkers for Parkinson's Disease Toolbox"
authors = ["Radboud, eScience Center"]
license = "Apache-2.0"
Expand Down