Skip to content

Commit

Permalink
Chore: Insert new project naming action into workflows (#389)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Watkins <[email protected]>
  • Loading branch information
ModeSevenIndustrialSolutions authored Sep 18, 2024
1 parent 1e605eb commit 42aa019
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 21 deletions.
1 change: 1 addition & 0 deletions .github/actions/python-project-naming/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ runs:
echo "matches_repo_name=$MATCHES_REPO_NAME" >> "$GITHUB_ENV"
# Write as action output
echo "github_repository_name=$GITHUB_REPOSITORY_NAME" >> "$GITHUB_OUTPUT"
echo "python_project_name=$PYTHON_PROJECT_NAME" >> "$GITHUB_OUTPUT"
echo "matches_repo_name=$MATCHES_REPO_NAME" >> "$GITHUB_OUTPUT"
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/github-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,15 @@ jobs:
contents: write

steps:
- name: "Capture repository/project name"
shell: bash
run: |
# Capture repository/project name
REPOSITORY_NAME=$(basename ${{ github.repository }})
echo "repository=$REPOSITORY_NAME" >> "$GITHUB_ENV"
- name: "Extract project/repository naming"
id: naming
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/python-project-naming@main

- name: "⬇ Download build artefacts"
uses: actions/download-artifact@v4
with:
name: ${{ env.repository }}-${{ inputs.build_tag }}
name: ${{ env.python_project_name }}-${{ inputs.build_tag }}
path: ${{ env.BUILD_ARTEFACTS }}

- name: "Check tag matches pyproject.toml"
Expand All @@ -52,7 +50,8 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: ${{ inputs.PRE_RELEASE }}
tag_name: ${{ inputs.build_tag }}
name: "${{ env.repository }} ${{ inputs.build_tag }}"
name: "${{ env.python_project_name }} ${{ inputs.build_tag }}"

# ToDo: Incorporate release notes, etc.
# body_path: ${{ github.workspace }}/CHANGELOG.rst
files: |
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/python-build-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ jobs:
with:
python-version: ${{ inputs.python_version }}

- name: "Extract project/repository naming"
id: naming
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/python-project-naming@main

- name: "Build Python project"
id: python-matrix-builds
uses: os-climate/osc-github-devops/.github/actions/python-build-project@main
Expand All @@ -68,18 +73,11 @@ jobs:
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/python-twine-check@main

- name: "Capture repository/project name"
shell: bash
run: |
# Capture repository/project name
REPOSITORY_NAME=$(basename ${{ github.repository }})
echo "repository=$REPOSITORY_NAME" >> "$GITHUB_ENV"
- name: "Upload build artefacts"
uses: actions/upload-artifact@v4
if: inputs.python_version == inputs.ARTEFACT_PYTHON
with:
name: ${{ env.repository }}-${{ inputs.build_tag }}
name: ${{ env.python_project_name }}-${{ inputs.build_tag }}
path: ${{ inputs.ARTEFACT_LOCATION }}

# This step optional and must be explicitly requested (pass the relevant input)
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/repository.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,6 @@ jobs:
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/python-versions-matrix@main

- name: "Extract project/repository naming"
id: naming
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/python-project-naming@main

python-build:
name: "Build"
uses: os-climate/osc-github-devops/.github/workflows/python-build-matrix.yaml@main
Expand Down
Empty file removed test.txt
Empty file.

0 comments on commit 42aa019

Please sign in to comment.