Skip to content

Chore: Bump versions prior to next test/release (#537) #21

Chore: Bump versions prior to next test/release (#537)

Chore: Bump versions prior to next test/release (#537) #21

---
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2024 The Linux Foundation
# Single workflow designed to test entire action/workflow suite end-to-end
name: "🤖 Build/Test/Release [Merge]"
# yamllint disable-line rule:truthy
on:
workflow_dispatch:
push:
paths:
- "**"
- "!.github/**"
- "!.*"
- "!pdm.lock"
- "!tox.ini"
# env:
# Uncomment the variable below to disable PyPI publishing
# pypi_publish_disable: "true"
# Uncomment the variable below to disable GitHub releasing
# gh_release_disable: "true"
permissions: {}
jobs:
one-password:
name: "1Password"
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/workflows/reuse-one-password.yaml@main
# Do NOT run until change is merged; secrets will NOT be available and workflow WILL fail
if: github.event_name != 'pull_request'
with:
ACCESS_TYPE: "production"
VAULT_ITEM: "op://hdiyadcjno2knqgvcy4wj5ulya/Test Secure Note/notesPlain"
EXPORT: false
secrets:
# Test development credentials
ONE_PASSWORD_DEVELOPMENT: ${{ secrets.ONE_PASSWORD_DEVELOPMENT }}
ONE_PASSWORD_PRODUCTION: ${{ secrets.ONE_PASSWORD_PRODUCTION }}
permissions: {}
check-secrets:
name: "Check credentials"
runs-on: ubuntu-24.04
permissions: {}
steps:
- name: "Check for required secrets/API keys/tokens"
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/test-github-secrets-action@main
with:
# Mandatory secrets/variables to check
pypi_development: ${{ secrets.PYPI_DEVELOPMENT }}
pypi_production: ${{ secrets.PYPI_PRODUCTION }}
one_password_development: ${{ secrets.ONE_PASSWORD_DEVELOPMENT }}
repository:
name: "Repository"
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/workflows/reuse-inspect-repository.yaml@main
permissions:
# Required for action that creates labels: github-labels
contents: read
python-build:
name: "Python build"
needs: repository
if: needs.repository.outputs.python_project == 'true'
runs-on: ubuntu-24.04
outputs:
matrix_json: ${{ steps.python-build.outputs.matrix_json }}
artefact_path: ${{ steps.python-build.outputs.artefact_path }}
permissions:
contents: write
# Required by SigStore signing action
id-token: write
# Required for attestations
attestations: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: "Build Python project"
id: python-build
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/python-project-build-action@main
with:
tag: ${{ needs.repository.outputs.build_tag }}
python-test:
name: "Test"
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/workflows/reuse-python-tests.yaml@main
needs:
- repository
- python-build
# Matrix job
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.python-build.outputs.matrix_json) }}
with:
python_version: ${{ matrix.python-version }}
permissions:
contents: read
python-audit:
name: "Audit"
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/workflows/reuse-python-audit.yaml@main
needs:
- repository
- python-build
# Matrix job
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.python-build.outputs.matrix_json) }}
with:
python_version: ${{ matrix.python-version }}
permissions:
contents: read
notebooks:
name: "Notebooks"
if: needs.repository.outputs.jupyter_notebooks == 'true'
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/workflows/reuse-notebook-tests.yaml@main
needs:
- repository
- python-build
# Matrix job
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.python-build.outputs.matrix_json) }}
with:
python_version: ${{ matrix.python-version }}
permissions:
contents: read
pypi-test:
name: "Test release: PyPI"
needs:
- repository
- python-build
- python-audit
- python-test
runs-on: "ubuntu-24.04"
permissions:
contents: read
# Needed for trusted publishing; must also be passed from parent workflows
id-token: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Note: environment must be specified at BOTH job level, and input to publish action
environment: development
steps:
# Need repository content to extract project name
- name: "Test Package Publishing"
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/python-pypi-publish-action@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
environment: development
tag: ${{ needs.repository.outputs.build_tag }}
# yamllint disable-line rule:line-length
one_password_item: "op://hdiyadcjno2knqgvcy4wj5ulya/tm2ffuusrynfivtcsnamginhm4/password"
op_service_account_token: ${{ secrets.ONE_PASSWORD_PRODUCTION }}
pypi_credential: ${{ secrets.PYPI_PRODUCTION }}
publish_disable: ${{ env.pypi_publish_disable }}
pypi-release:
name: "Release: PyPI"
# yamllint disable-line rule:line-length
if: startsWith(github.ref, 'refs/tags/') || contains(github.event.head_commit.message, '[release]')
needs:
- repository
- pypi-test
runs-on: "ubuntu-24.04"
permissions:
contents: read
# Needed for trusted publishing; must also be passed from parent workflows
id-token: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Note: environment must be specified at BOTH job level, and input to publish action
environment: production
steps:
# Need repository content to extract project name
- name: "Release to PyPI"
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/python-pypi-publish-action@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
environment: production
tag: ${{ needs.repository.outputs.build_tag }}
# yamllint disable-line rule:line-length
one_password_item: "op://hdiyadcjno2knqgvcy4wj5ulya/vds5rebqxeqfrjqwpszxxicmzq/password"
op_service_account_token: ${{ secrets.ONE_PASSWORD_PRODUCTION }}
pypi_credential: ${{ secrets.PYPI_PRODUCTION }}
publish_disable: ${{ env.pypi_publish_disable }}
github-release:
name: "Release: GitHub"
# yamllint disable-line rule:line-length
if: startsWith(github.ref, 'refs/tags/') || contains(github.event.head_commit.message, '[release]')
needs:
- repository
- pypi-test
runs-on: "ubuntu-24.04"
permissions:
contents: write
steps:
- name: "GitHub Release"
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/github-release-action@main
with:
project_name: ${{ env.python_project_name }}
artefact_location: "dist"
tag: ${{ needs.repository.outputs.build_tag }}
github_token: ${{ secrets.GITHUB_TOKEN }}