Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Release

Release #9

Workflow file for this run

# encoding: utf-8
# This file is part of CycloneDX Python
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) OWASP Foundation. All Rights Reserved.
name: Release
on:
workflow_dispatch:
concurrency:
group: release
cancel-in-progress: false
env:
PYTHON_VERSION_DEFAULT: "3.9"
POETRY_VERSION: "1.1.15"
jobs:
release:
# https://github.community/t/how-do-i-specify-job-dependency-running-in-another-workflow/16482
# limit this to being run on regular commits, not the commits that semantic-release will create
if: github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'chore(release):')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup python
# see https://github.com/actions/setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
architecture: 'x64'
- name: Install and configure Poetry
# See https://github.com/marketplace/actions/install-poetry-action
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install dependencies
run: poetry install --no-root
- name: View poetry version
run: poetry --version
- name: Python Semantic Release
# see https://python-semantic-release.readthedocs.io/en/latest/automatic-releases/github-actions.html
# see https://github.com/python-semantic-release/python-semantic-release
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repository_username: __token__
repository_password: ${{ secrets.PYPI_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN }}