Skip to content

feature(package): Added version/packaging/release steps. #1

feature(package): Added version/packaging/release steps.

feature(package): Added version/packaging/release steps. #1

Workflow file for this run

name: Package and Release
on:
push:
# NOTE: From https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
tags: ["^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"]
jobs:
release:
runs-on: ubuntu-latest
needs: bumpver
steps:
# NOTE: https://github.com/actions/download-artifact
- name: Checkout.
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get Body.
run: |
tag_body=$( git tag -l --format='%(contents:body)' 0.1.5 )
echo "CAPTURA_TAG_BODY=$tag_body" >> $GITHUB_ENV
- name: Get Artifacts.
uses: actions/download-artifact@v4
with:
name: captura-build-${{ git.ref_name }}
github-token: ${{ secrets.GH_PAT }}
path: ./dist
- name: Publish to PyPI.
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Create Release
id: release-create
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref_name }}
release_name: Version ${{ github.ref_name }}
body: ${{ env.TAG_BODY }}
draft: false
prerelease: false