Skip to content

Commit

Permalink
DOC, CI: added CITATION.cff, updated changelog, modernized publicatio…
Browse files Browse the repository at this point in the history
…n workflow
  • Loading branch information
jotelha committed Jul 9, 2024
1 parent e4b3a65 commit e6f115c
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 10 deletions.
109 changes: 99 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,133 @@ on:
- '*'

jobs:
test:

build:
name: Build
runs-on: ubuntu-latest

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

- name: Set up Python 3.8
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12

- name: Install requirements
run: |
pip install --upgrade build
pip install --upgrade setuptools wheel setuptools-scm[toml] importlib-metadata
pip install git+https://github.com/livMatS/dservercore.git@main
pip install git+https://github.com/jic-dtool/dservercore.git@main
pip list
- name: Package distribution
run: |
python -m build
- name: Publish distribution to Test PyPI
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/


publish-to-testpypi:
name: Publish to TestPyPI
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/dserver-notification-plugin

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/

- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository-url: https://test.pypi.org/legacy/
verbose: true
skip-existing: true


publish-to-pypi:
name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/dserver-notification-plugin # Replace <package-name> with your PyPI project name
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/

- name: Publish distribution to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
verbose: true


github-release:
name: >-
Make github release
needs:
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/

- name: Sign with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# 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/**
--repo '${{ github.repository }}'
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Change log for dserver-notification-plugin
==========================================

0.4.1 (9Jul24)
---------------

* Automated github release creation

0.4.0 (13Jun24)
---------------

Expand Down
11 changes: 11 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cff-version: 1.2.0
authors:
- family-names: Hörmann
given-names: Johannes Laurin
orcid: 0000-0001-5867-695X
- family-names: Pastewka
given-names: Lars
orcid: 0000-0001-8351-7336
title: dserver-notification-plugin
version: 0.4.1
date-released: 2024-07-09

0 comments on commit e6f115c

Please sign in to comment.