Merge pull request #911 from Crown-Commercial-Service/use-aws-cli-for… #183
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a release using the version number from the Python package | |
# | |
# This workflow is designed to create a GitHub release whenever a pull request | |
# is merged to the main branch that updates the version number for this repo's | |
# Python package. | |
# | |
# The release is created with the tag and name of the version number. | |
# | |
# If there already exists a tag for the package version number the release | |
# should not be created. | |
name: Create a GitHub release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
- name: Get package version | |
id: package_version | |
run: echo "::set-output name=python::"$(python setup.py --version) | |
- name: Check if version tag already exists | |
id: version_tag | |
uses: mukunku/tag-exists-action@78009d2b13e10ba051fe68d8d2f6778a9b2adab3 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag: ${{ steps.package_version.outputs.python }} | |
- name: Create GitHub release | |
if: ${{ steps.version_tag.outputs.exists == 'false' }} | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.DM_GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.package_version.outputs.python }} | |
release_name: Release v${{ steps.package_version.outputs.python }} |