|
name: release |
|
|
|
on: |
|
workflow_dispatch: |
|
inputs: |
|
bump: |
|
description: 'Tipo de bump' |
|
type: choice |
|
required: true |
|
default: minor |
|
options: [patch, minor, major] |
|
release-notes: |
|
description: 'Release notes (markdown, opcional)' |
|
type: string |
|
required: false |
|
|
|
jobs: |
|
release: |
|
if: github.ref == 'refs/heads/master' |
|
runs-on: ubuntu-latest |
|
permissions: |
|
contents: write |
|
steps: |
|
- name: Checkout to commit code |
|
uses: actions/checkout@v3 |
|
|
|
- name: Set up Python |
|
uses: actions/setup-python@v4 |
|
with: |
|
python-version: "3.10.6" |
|
|
|
- name: Install Poetry |
|
run: | |
|
make get-poetry |
|
echo $HOME/.poetry/bin >> $GITHUB_PATH |
|
|
|
- name: Set up environment cache |
|
uses: actions/cache@v3 |
|
id: environment-cache |
|
with: |
|
key: environment-cache-v1-${{ hashFiles('**/poetry.lock') }} |
|
path: .venv |
|
|
|
- name: Install dependencies |
|
if: steps.poetry-cache.outputs.cache-hit != 'true' |
|
run: poetry install |
|
|
|
- uses: fintoc-com/release-action/prepare@main |
|
id: prep |
|
with: |
|
bump: ${{ inputs.bump }} |
|
version-format: py |
|
tag-prefix: v |
|
app-id: ${{ vars.FIN_RELEASES_APP_ID }} |
|
app-private-key: ${{ secrets.FIN_RELEASES_PRIVATE_KEY }} |
|
|
|
- name: Build the package |
|
run: poetry build |
|
|
|
- name: Publish the package |
|
uses: pypa/gh-action-pypi-publish@release/v1 |
|
with: |
|
user: __token__ |
|
password: ${{ secrets.PYPI_API_TOKEN }} |
|
|
|
- uses: fintoc-com/release-action/finalize@main |
|
with: |
|
tag: ${{ steps.prep.outputs.tag }} |
|
release-notes: ${{ inputs.release-notes }} |
|
app-id: ${{ vars.FIN_RELEASES_APP_ID }} |
|
app-private-key: ${{ secrets.FIN_RELEASES_PRIVATE_KEY }} |