Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tidy workflows #14

Merged
merged 6 commits into from
Jul 10, 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
41 changes: 0 additions & 41 deletions .github/workflows/CD/deploy_to_pypi.yml

This file was deleted.

80 changes: 0 additions & 80 deletions .github/workflows/bump_version.yml

This file was deleted.

51 changes: 24 additions & 27 deletions .github/workflows/deploy_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,40 @@ name: Publish the completed package to Pypi

on:
workflow_call:
inputs:
workflow_run_id:
type: string
required: true
description: 'The ID of the workflow which triggered this workflow'
artefact-version:
type: string
required: true
description: 'the version of the artefact'

# permissions: # Global permissions configuration starts here
# contents: read # 'read' access to repository contents
# pull-requests: read # 'write' access to pull requests

jobs:

deploy_to_pypi:
deploy_to_pypi_test:
runs-on: ubuntu-latest
environment:
name: 'published'
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: download artefact from previous run
uses: actions/download-artifact@v4
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
with:
python-version: 3.12
- uses: snok/install-poetry@93ada01c735cc8a383ce0ce2ae205a21c415379b # v1
with:
version: 1.8.3 # pin the version as they keep changing their APIs
virtualenvs-create: false
virtualenvs-in-project: false
- name: Install dependencies
run-id: ${{ github.event.inputs.workflow_run_id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: extract artefact
run: |
python -m venv venv
. venv/bin/activate
poetry install --with dev --no-interaction --sync
python -c "import os; print(os.environ['VIRTUAL_ENV'])"
- name: Build
run: poetry build
- name: Use Pypi test
tar -xvf *.tar.gz
- name: extract version from pyproject.toml
run: |
poetry config repositories.test-pypi https://test.pypi.org/legacy/
poetry config pypi-token.test-pypi ${{ secrets.PYPI_TOKEN }}
- name: Publish
run: poetry publish -r test-pypi
version=$(grep 'version =' pyproject.toml | awk '{print $3}' | sed 's/"//g')
echo "VERSION=$version" >> $GITHUB_ENV
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/



Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
bump:
uses: ./.github/workflows/CD/bump_version.yml
uses: ./.github/workflows/deploy_bump_version.yml
environment:
name: 'bump-version'
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ name: CodeQL

on:
workflow_call:
push:
branches-ignore:
- main
# push:
# branches-ignore:
# - main
schedule:
- cron: "43 4 * * 3"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency Review'
on:
pull_request:
workflow_call:

permissions:
contents: read
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: test package

on:
workflow_call:
push:
branches-ignore:
- main
# push:
# branches-ignore:
# - main


permissions: # Global permissions configuration starts here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ jobs:
actions: read
contents: read
security-events: write
uses: ./.github/workflows/codeql.yml
uses: ./.github/workflows/test_codeql.yml

test:
uses: ./.github/workflows/test-workflow.yml
uses: ./.github/workflows/test_run_pytest.yml

dependencies:
uses: ./.github/workflows/test_dependency_review.yml


# bump_version:
Expand Down
Loading