2024-07-17 20:35:05 +02:00
|
|
|
name: build pypackage and create release
|
2024-02-20 08:59:05 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*.*.*"
|
|
|
|
|
|
|
|
pull_request:
|
|
|
|
branches: [main, master]
|
|
|
|
|
|
|
|
jobs:
|
2024-07-17 20:35:05 +02:00
|
|
|
release-github:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
HATCH_INDEX_REPO: main
|
|
|
|
HATCH_INDEX_USER: __token__
|
|
|
|
HATCH_INDEX_AUTH: ${{ secrets.PACKAGE_TOKEN }}
|
|
|
|
steps:
|
|
|
|
- name: checkout code
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: actions/setup-python@v5
|
|
|
|
with:
|
|
|
|
python-version: "3.11"
|
|
|
|
|
|
|
|
- name: setup go
|
2024-07-18 08:21:47 +02:00
|
|
|
uses: actions/setup-go@v5
|
2024-07-17 20:35:05 +02:00
|
|
|
with:
|
|
|
|
go-version: ">=1.20"
|
|
|
|
|
2024-08-30 10:12:53 +02:00
|
|
|
- name: install hatch
|
2024-07-17 20:35:05 +02:00
|
|
|
run: pip install -U hatch hatchling
|
|
|
|
|
|
|
|
- name: build package
|
|
|
|
run: hatch build --clean
|
|
|
|
|
|
|
|
- name: install auto-changelog
|
|
|
|
run: npm install auto-changelog
|
|
|
|
|
|
|
|
- name: generate changelog
|
|
|
|
run: >-
|
|
|
|
npx auto-changelog -t keepachangelog
|
|
|
|
--commit-limit 50 --backfill-limit 50
|
|
|
|
--ignore-commit-pattern '[Bb]ump version|[Uu]pdate changelog|[Mm]erge pull request'
|
|
|
|
|
|
|
|
- name: get release notes
|
|
|
|
id: release-notes
|
|
|
|
uses: olofvndrhr/releasenote-gen@v1
|
|
|
|
|
|
|
|
- name: publish package
|
|
|
|
if: gitea.event_name != 'pull_request'
|
|
|
|
run: hatch publish --yes --no-prompt
|
|
|
|
|
|
|
|
- name: create gitea release
|
|
|
|
uses: https://gitea.com/actions/release-action@main
|
|
|
|
if: gitea.event_name != 'pull_request'
|
|
|
|
with:
|
|
|
|
title: ${{ gitea.ref_name }}
|
|
|
|
body: ${{ steps.release-notes.outputs.releasenotes }}
|
|
|
|
files: |-
|
|
|
|
dist/**
|