Skip to content

GitHub Release

GitHub Release #31

Workflow file for this run

name: GitHub Release
env:
pipenv_version: 2024.4.0
python_version: '3.11'
on:
workflow_dispatch:
inputs:
release_type:
description:
"Enter type of release to perform (i.e. development, beta, release):"
required: true
jobs:
release:
name: Carry out a release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.python_version }}
- name: Determine dependencies
# Note
# The below code generates a pip requirements file from the pipenv development requirements (also obtaining the
# normal dependencies from setup.py).
# This code also forces the system to install latest tools as the ones present on the CI system may be too old
# for the process to go through properly.
run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install pipenv==${{ env.pipenv_version }}
echo "Locking dependencies"
python -m pipenv lock
python -m pipenv requirements > dev-requirements.txt
- uses: FranzDiebold/github-env-vars-action@v2
- name: Load Python Dependencies from cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: linux-pip-3-continuous-delivery-scripts
- name: Install dependencies
# Note
# As a virtual machine is already being used, pipenv
# is superfluous and eliminating pipenv in CI reduces overhead and reduce complexity, while retaining a single
# location for development dependencies.
run: |
python -m pip install -r dev-requirements.txt
python -m pip list
- name: Generate SPDX documents
run: |
mkdir -p ./spdx-tmp
cd-generate-spdx --output-dir ./spdx-tmp
- name: Generate Documentation
run: |
cd-generate-docs --output_dir $(cd-get-config --key DOCUMENTATION_PRODUCTION_OUTPUT_PATH)
- name: Add copyright/licence notice.
run: |
cd-license-files
- name: Tag and release
run: cd-tag-and-release -b ${CI_ACTION_REF_NAME} -t ${{ github.event.inputs.release_type }} -vv
env:
# Using a specific token because GITHUB_TOKEN is not available https://github.com/marketplace/actions/workflow-dispatch#token
GIT_TOKEN: ${{ secrets.GIT_SECRET }}
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
IGNORE_REPOSITORY_TEST_UPLOAD: true