e3005b8cff
Signed-off-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
68 lines
1.9 KiB
YAML
68 lines
1.9 KiB
YAML
name: Release drafter
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
|
|
jobs:
|
|
draft-a-release:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
issues: write
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
- id: get_approvers
|
|
run: |
|
|
echo "approvers=$(cat .github/CODEOWNERS | grep @ | tr -d '* ' | sed 's/@/,/g' | sed 's/,//1')" >> $GITHUB_OUTPUT
|
|
- uses: trstringer/manual-approval@v1
|
|
with:
|
|
secret: ${{ github.TOKEN }}
|
|
approvers: ${{ steps.get_approvers.outputs.approvers }}
|
|
minimum-approvals: 1
|
|
issue-title: 'Release opensearch-py'
|
|
issue-body: "Please approve or deny the release of opensearch-py. **Tag**: ${{ github.ref_name }} **Commit**: ${{ github.sha }}"
|
|
exclude-workflow-initiator-as-approver: true
|
|
- name: Set up Python 3
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.x'
|
|
- name: Install build tools
|
|
run: |
|
|
python -m pip install --upgrade build
|
|
- name: Build project for distribution
|
|
run: |
|
|
python -m build
|
|
- name: upload windows dists
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-dists
|
|
path: dist/
|
|
|
|
pypi-publish:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- draft-a-release
|
|
permissions:
|
|
id-token: write
|
|
contents: write
|
|
steps:
|
|
- name: Retrieve release distributions
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: release-dists
|
|
path: dist
|
|
- name: Generate the artifacts
|
|
run: |
|
|
tar -zvcf artifacts.tar.gz dist
|
|
- name: Publish package distributions to PyPI
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
generate_release_notes: true
|
|
files: |
|
|
artifacts.tar.gz
|