Skip to content

Commit

Permalink
🚀 chore(release.yml): rename release workflow to "Reusable Release Wo…
Browse files Browse the repository at this point in the history
…rkflow" for clarity and consistency

🔧 fix(release.yml): update poetry installation command to use "pip" instead of "pipx" to ensure compatibility
🔧 fix(release.yml): update Python setup step to be more generic and not specific to version 3.10
🔧 fix(release.yml): update build project step to use the provided build command input instead of "make build"
🔧 fix(release.yml): update check version step to properly append the version output to the GITHUB_OUTPUT file
  • Loading branch information
Matheus committed Mar 7, 2024
1 parent 6d48fb1 commit 949e44f
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,44 @@
name: release
name: Reusable Release Workflow

on:
workflow_call:
inputs:
working-directory:
required: true
type: string
description: "From which folder this pipeline executes"
pull_request:
types:
- closed
branches:
- main
paths:
- "pyproject.toml"
description: "Directory from which this pipeline executes"
component-path:
required: true
type: string
description: "Relative path to the component being released"
secrets:
GITHUB_TOKEN:
required: true
PYPI_API_TOKEN:
required: true

env:
POETRY_VERSION: "1.5.1"

jobs:
if_release:
if: ${{ (github.event.pull_request.merged == true) && contains(github.event.pull_request.labels.*.name, 'Release') }}
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry==$POETRY_VERSION
- name: Set up Python 3.10
run: |
pip install poetry==$POETRY_VERSION
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
- name: Build project for distribution
run: make build
run: ${{ inputs.build_cmd }}
- name: Check Version
id: check-version
run: |
echo version=$(poetry version --short) >> $GITHUB_OUTPUT
echo "version=$(poetry version --short)" >> $GITHUB_OUTPUT
- name: Create Release
uses: ncipollo/release-action@v1
with:
Expand Down

0 comments on commit 949e44f

Please sign in to comment.