Skip to content

Pipeline publish#42

Draft
jdamp-bis wants to merge 5 commits intomainfrom
pipeline-publish
Draft

Pipeline publish#42
jdamp-bis wants to merge 5 commits intomainfrom
pipeline-publish

Conversation

@jdamp-bis
Copy link
Contributor

@jdamp-bis jdamp-bis commented Apr 25, 2025

Summary

This PR introduces two pipeline jobs to publish the documentation to GitHub pages and a package version to pypi.

  • In ci.yaml, a pipeline running due to a push on main will upload the quarto docs artifact to GitHub pages
  • In publish-release.yaml, a push to main

Open points:

  • Publish to pypi: Use environment secrets? How do we make sure these secrets cannot be extracted?
  • Should we run the publish to pypi step only once

Other notes:
This would require setting the new version as part of the PR, as it needs to be available when the package is build in the pipeline after the PR is merged.
Potentially, we can also make the publish-release step a manual one, requiring explicit start.

Comment on lines +45 to +62
runs-on: ubuntu-latest
needs: build
if: ${{ success() && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
steps:
- name: Download quarto-docs artifact
uses: actions/download-artifact@v4
with:
name: quarto-docs
path: docs

- name: Upload pages artifact
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: docs

- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Comment on lines +9 to +32
name: Release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: pip install twine

- name: Build
run: python .\setup.py sdist bdist_wheel

- name: Check
run: python -m twine check dist/*

- name: Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload dist/*

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
@dkgaraujo
Copy link
Contributor

@jdamp-bis I think it would be a good idea to follow GitHub's suggestion and add permissions to the job: https://github.com/bis-med-it/gingado/security/code-scanning/4.

Could you please implement it when you have some time?

- fix: syntax issue in bash statement
- fix: add missing workflow permissions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants