58 lines
2.2 KiB
YAML
58 lines
2.2 KiB
YAML
name: Publish Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: 'Tag to publish (e.g. v0.7.0)'
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: docker
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Install CI tools
|
|
run: |
|
|
. .env 2>/dev/null || true
|
|
python3 -m pip install --break-system-packages --target=src "devx==0.9.12" --extra-index-url "https://emil:${{ secrets.REPO_TOKEN }}@git.oblachno.oblachno.fyi/api/packages/oblachno-oss/pypi/simple/"
|
|
python3 -m pip install --break-system-packages --target=src "devx==0.9.12" --extra-index-url "https://emil:${{ secrets.REPO_TOKEN }}@git.oblachno.oblachno.fyi/api/packages/oblachno-oss/pypi/simple/"
|
|
python3 -m pip install --break-system-packages --target=src "devx==0.9.12" --extra-index-url "https://emil:${{ secrets.REPO_TOKEN }}@git.oblachno.oblachno.fyi/api/packages/oblachno-oss/pypi/simple/"
|
|
python3 -m devx.tools.install_tools --tool git-cliff --tool tea
|
|
- name: Install build tools
|
|
run: python3 -m pip install --break-system-packages build twine
|
|
- name: Configure tea login
|
|
env:
|
|
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
|
|
run: |
|
|
export PATH="$HOME/.local/bin:$PATH"
|
|
- name: Build and publish release
|
|
env:
|
|
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
|
|
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
|
PYTHONPATH: src
|
|
run: |
|
|
export PATH="$HOME/.local/bin:$PATH"
|
|
python3 -m devx.ci.publish \
|
|
"${{ github.event.inputs.tag || github.ref_name }}" \
|
|
"${{ github.repository }}"
|
|
- name: Notify on failure
|
|
if: failure()
|
|
env:
|
|
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
|
|
PYTHONPATH: src
|
|
run: |
|
|
export PATH="$HOME/.local/bin:$PATH"
|
|
python3 -m devx.ci.notify_failure --auto-login \
|
|
--repo "${{ github.repository }}" \
|
|
--run-id "${{ github.run_id }}" \
|
|
--workflow "publish" \
|
|
--commit "${{ github.sha }}"
|