Skip to content

Commit 559ae41

Browse files
committed
Merge branch 'main' of github.com:Scale3-Labs/langtrace-python-sdk into development
2 parents 8d3bd23 + a8c6cc4 commit 559ae41

File tree

2 files changed

+71
-8
lines changed

2 files changed

+71
-8
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"attachments": [
3+
{
4+
"pretext": "{{ env.PRE_TEXT_MESSAGE }}",
5+
"fallback": "{{ env.FALLBACK_MESSAGE }}",
6+
"color": "{{ env.COLOR }}",
7+
"author_name": "{{ github.workflow }}",
8+
"author_link": "{{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/actions/runs/{{ env.GITHUB_RUN_ID }}",
9+
"title": "{{ env.GITHUB_REPOSITORY }}",
10+
"title_link": "{{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}",
11+
"fields": [
12+
{
13+
"title": "Release Tag",
14+
"short": true,
15+
"value": "{{ env.RELEASETAG }}"
16+
}
17+
],
18+
"footer": "deployed by: {{ github.actor }}",
19+
"footer_icon": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"
20+
}
21+
]
22+
}

.github/workflows/release.yml

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ jobs:
2121
- name: Set up Python
2222
uses: actions/setup-python@v2
2323
with:
24-
python-version: '3.x'
24+
python-version: "3.x"
2525

2626
- name: Install hatch
27-
run: |
27+
run: |
2828
pip install hatch
29-
29+
3030
- name: Get Version
3131
id: version
32-
run: |
32+
run: |
3333
echo "version=$(hatch version)" >> $GITHUB_OUTPUT
34-
34+
3535
publish:
3636
runs-on: ubuntu-latest
3737
needs:
@@ -54,17 +54,58 @@ jobs:
5454
- name: Set up Python
5555
uses: actions/setup-python@v2
5656
with:
57-
python-version: '3.x'
57+
python-version: "3.x"
5858

5959
- name: Install hatch
60-
run: |
60+
run: |
6161
pip install hatch
6262
6363
- name: Build SDK
64-
run: |
64+
run: |
6565
hatch build
6666
6767
- name: Publish Python 🐍 distributions 📦 to PyPI
6868
uses: pypa/gh-action-pypi-publish@master
6969
with:
7070
password: ${{ secrets.PYPI_TOKEN }}
71+
72+
post-release:
73+
name: Post Release Actions
74+
75+
runs-on: ubuntu-latest
76+
if: ${{ always() }}
77+
needs:
78+
- generate-version
79+
- publish
80+
81+
steps:
82+
- name: Checkout main branch
83+
uses: actions/[email protected]
84+
with:
85+
ref: main
86+
87+
- name: Slack - Success Message
88+
uses: DSdatsme/slack-github-action@env_support
89+
if: ${{ success() && needs.publish.result == 'success' }}
90+
with:
91+
channel-id: ${{ vars.SLACK_CHANNEL_ID }}
92+
payload-file-path: ./.github/resources/slack-payloads/slack-message-template.json
93+
env:
94+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
95+
RELEASETAG: ${{ needs.generate-version.outputs.new_version }}
96+
PRE_TEXT_MESSAGE: "Workflow Passed! :successkid:"
97+
FALLBACK_MESSAGE: "Workflow Passed!"
98+
COLOR: "good"
99+
100+
- name: Slack - Failure Message
101+
uses: DSdatsme/slack-github-action@env_support
102+
if: ${{ failure() || needs.publish.result != 'success' }}
103+
with:
104+
channel-id: ${{ vars.SLACK_CHANNEL_ID }}
105+
payload-file-path: ./.github/resources/slack-payloads/slack-message-template.json
106+
env:
107+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
108+
RELEASETAG: ${{ needs.generate-version.outputs.new_version }}
109+
PRE_TEXT_MESSAGE: "<!channel> Workflow Failed! :x:"
110+
FALLBACK_MESSAGE: "Workflow Failed!"
111+
COLOR: "danger"

0 commit comments

Comments
 (0)