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

Chore: Update DevOps tooling from central repository [skip ci] #445

Merged
merged 1 commit into from
Apr 29, 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
17 changes: 13 additions & 4 deletions .github/workflows/builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,25 @@ jobs:

- name: "Performing build"
run: |
PDM_CMD=$(which pdm)
python -m pip install --upgrade pip
if [ -f tox.ini ]; then
python -m pip install --upgrade pip
pip install tox tox-gh-actions
echo "Found file: tox.ini"
echo "Building with command: tox -e build"
tox -e build
elif [ -x "$PDM_CMD" ]; then
elif [ -f pyproject.toml ]; then
echo "Found file: pyproject.toml"
echo "Building with command: pdm build"
pdm build
else
echo "Building with command: python -m build"
echo "Neither file found: tox.ini/pyproject.toml"
pip install --upgrade build
echo "Attempting build with: python -m build"
python -m build
fi

- name: "Validating Artefacts with Twine"
run: |
echo "Validating artefacts with: twine check dist/*"
pip install --upgrade twine
twine check dist/*
22 changes: 21 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,22 @@ on:
# workflow_dispatch:
push:
# Only invoked on release tag pushes
branches:
- '**'
tags:
- v*.*.*
- 'v*.*.*'

env:
python-version: "3.10"

### BUILD ###

jobs:

build:
name: "🐍 Build packages"
# Only publish on tag pushes
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
# IMPORTANT: mandatory for Sigstore
Expand Down Expand Up @@ -95,6 +100,21 @@ jobs:
dist/*.whl
dist/*.sigstore

- name: "📦 Publish artefacts to GitHub"
# https://github.com/softprops/action-gh-release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
tag_name: ${{ github.ref_name }}
name: "Test/Development Build \
${{ github.ref_name }}"
# body_path: ${{ github.workspace }}/CHANGELOG.rst
files: |
dist/*.tar.gz
dist/*.whl
dist/*.sigstore

### PUBLISH PYPI TEST ###

testpypi:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,16 @@ jobs:
echo "tarball=$(ls dist/*.tgz)" >> "$GITHUB_OUTPUT"
echo "wheel=$(ls dist/*.whl)" >> "$GITHUB_OUTPUT"

- name: "📦 Publish packages to GitHub"
uses: ModeSevenIndustrialSolutions/action-automatic-releases@latest
- name: "📦 Publish artefacts to GitHub"
# https://github.com/softprops/action-gh-release
uses: softprops/action-gh-release@v2
with:
# Valid inputs are:
# repo_token, automatic_release_tag, draft, prerelease, title, files
repo_token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
automatic_release_tag: ${{ steps.setenv.outputs.vernum }}
title: "Development Build \
tag_name: ${{ steps.setenv.outputs.vernum }}
name: "Test/Development Build \
${{ steps.setenv.outputs.vernum }}"
# body_path: ${{ github.workspace }}/CHANGELOG.rst
files: |
dist/*.tar.gz
dist/*.whl
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Temporary devops repo
.devops

# Twine temporary files
package-lock.json
package.json

# Output files from co2budget.ipynb (ITR-Examples)
OECM-images
TPI-images


# Local node cache
node_modules

Expand Down
Loading