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

Fix: Broken workflow syntax #67

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
8 changes: 4 additions & 4 deletions .github/actions/increment-semantic-tag/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ runs:
echo "Supplied tag: $TAG"
fi

local RE='[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z-]*\)'
local MAJOR=$(echo "$TAG" | sed -e "s#$RE#\1#")
local MINOR=$(echo "$TAG" | sed -e "s#$RE#\2#")
local PATCH=$(echo "$TAG" | sed -e "s#$RE#\3#")
RE='[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z-]*\)'
MAJOR=$(echo "$TAG" | sed -e "s#$RE#\1#")
MINOR=$(echo "$TAG" | sed -e "s#$RE#\2#")
PATCH=$(echo "$TAG" | sed -e "s#$RE#\3#")

case "$TYPE" in
major)
Expand Down
145 changes: 0 additions & 145 deletions .github/actions/python-matrix-builds/action.yaml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/actions/python-project-build/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2024 The Linux Foundation <https://linuxfoundation.org>

name: "🧱 Python Build"
description: "Build Python Project"

inputs:
artefacts:
description: "Path to Python build artefacts"
required: false
default: "dist"

runs:
using: "composite"
steps:
- name: "Populate environment variables"
id: setenv
shell: bash
run: |
echo "Action triggered by user: ${GITHUB_TRIGGERING_ACTOR}"
datetime=$(date +'%Y%m%d%H%M')
export datetime
echo "datetime=${datetime}" >> "$GITHUB_OUTPUT"

- name: "Performing build"
shell: bash
run: |
python -m pip install --upgrade pip
if [ -f tox.ini ]; then
pip install tox tox-gh-actions
echo "Found file: tox.ini"
echo "Building with command: tox -e build"
tox -e build
elif [ -f pyproject.toml ]; then
echo "Found file: pyproject.toml"
echo "Building with command: pdm build"
pdm build
else
echo "Neither file found: tox.ini/pyproject.toml"
pip install --upgrade build
echo "Attempting build with: python -m build"
python -m build
fi
14 changes: 8 additions & 6 deletions .github/workflows/test-gha-workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,23 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: "Setup PDM for build commands"
- name: "Setup PDM Build Tool"
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}

- name: "Build: Python project"
id: perform-matrix-builds
- name: "Build: Python Project"
id: python-project-build
# yamllint disable-line rule:line-length
uses: os-climate/devops-reusable-workflows/.github/actions/python-matrix-builds@main
uses: os-climate/devops-reusable-workflows/.github/actions/python-project-build@main
with:
artefacts: "dist"

- name: "Validate Artefacts with Twine"
id: twine-check-artefacts
id: python-twine-check
with:
output-location: ${{ env.artefacts}}
uses: os-climate/devops-reusable-workflows/.github/actions/twine-check-artefacts@main
uses: os-climate/devops-reusable-workflows/.github/actions/python-twine-check@main

test:
name: "Test: GitHub Actions/Workflows"
Expand Down