mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-11-15 01:23:59 +00:00
Automate release on PyPi (#4015)
This commit is contained in:
parent
3fcfc8eb23
commit
e8ff48094b
32
.github/config/pypi-release-slack-notification.yml
vendored
Normal file
32
.github/config/pypi-release-slack-notification.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
pretext: Triggered via {{eventName}} of {{env.VERSION}} by {{actor}}
|
||||||
|
title: "Haystack PyPi release"
|
||||||
|
|
||||||
|
text: |
|
||||||
|
<https://pypi.org/project/farm-haystack/{{env.VERSION}}/|PyPi release {{env.VERSION}}>
|
||||||
|
|
||||||
|
{{#if (eq jobStatus "SUCCESS")}}
|
||||||
|
Haystack {{env.VERSION}} has been released on PyPi :rocket:
|
||||||
|
{{else if (eq jobStatus "FAILURE")}}
|
||||||
|
{{icon jobStatus}} Haystack {{env.VERSION}} PyPi release failed! {{icon jobStatus}}
|
||||||
|
{{else if (eq jobStatus "CANCELLED")}}
|
||||||
|
{{icon jobStatus}} Haystack {{env.VERSION}} PyPi release has been cancelled! {{icon jobStatus}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
fallback: |-
|
||||||
|
Haystack {{env.VERSION}} PyPi release status: {{jobStatus}}
|
||||||
|
|
||||||
|
footer: >-
|
||||||
|
<{{repositoryUrl}}|{{repositoryName}}> <{{workflowRunUrl}}|{{workflow}} #{{runNumber}}>
|
||||||
|
|
||||||
|
colors:
|
||||||
|
success: "#5DADE2"
|
||||||
|
failure: "#884EA0"
|
||||||
|
cancelled: "#A569BD"
|
||||||
|
default: "#7D3C98"
|
||||||
|
|
||||||
|
icons:
|
||||||
|
success: ":white_check_mark:"
|
||||||
|
failure: ":x:"
|
||||||
|
cancelled: ":interrobang:"
|
||||||
|
skipped: ":interrobang:"
|
||||||
|
default: ":interrobang:"
|
||||||
35
.github/workflows/pypi_release.yml
vendored
Normal file
35
.github/workflows/pypi_release.yml
vendored
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
name: Project release on PyPi
|
||||||
|
|
||||||
|
on:
|
||||||
|
tags:
|
||||||
|
- "v[0-9].[0-9]+.[0-9]+*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release-on-pypi:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install Hatch
|
||||||
|
run: pip install hatch
|
||||||
|
|
||||||
|
- name: Build Haystack
|
||||||
|
run: hatch build
|
||||||
|
|
||||||
|
- name: Publish on PyPi
|
||||||
|
env:
|
||||||
|
HATCH_INDEX_USER: __token__
|
||||||
|
HATCH_INDEX_AUTH: ${{ secrets.PYPI_API_TOKEN }}
|
||||||
|
run: hatch publish -y
|
||||||
|
|
||||||
|
- name: Notify Slack
|
||||||
|
env:
|
||||||
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||||
|
if: always()
|
||||||
|
uses: act10ns/slack@v2
|
||||||
|
with:
|
||||||
|
status: ${{ job.status }}
|
||||||
|
channel: "#haystack"
|
||||||
|
config: .github/config/pypi-release-slack-notification.yml
|
||||||
Loading…
x
Reference in New Issue
Block a user