Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
Manual version tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
blinktag committed Oct 30, 2023
1 parent fe622e9 commit 092d016
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 50 deletions.
29 changes: 1 addition & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Main Test
on:
push:
branches:
Expand Down Expand Up @@ -58,30 +58,3 @@ jobs:
GIT_BRANCH=main ./cc-test-reporter after-build \
-r ${{ secrets.CC_TEST_REPORTER_ID }} \
-t coverage.py
build:
outputs:
new_tag: ${{ steps.create_tag.outputs.new_tag }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Generate new tag (dry run)
uses: mathieudutour/[email protected]
id: get_new_version
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
dry_run: true
- name: Build python dist
run: |
sed -i "s/version=\".*\"/version=\"${{ steps.get_new_version.outputs.new_version }}\"/" streamdal/__init__.py
sed -i "s/version=.*/version='${{ steps.get_new_version.outputs.new_version }}',/" setup.py
python3 setup.py sdist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Create tag
uses: mathieudutour/[email protected]
id: create_tag
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

on:
push:
tags:
- 'v*.*.*'

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Get tag name
run: echo "TAG_NAME=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
- name: Get version
run: echo "TAG_VERSION=$(echo ${GITHUB_REF#refs/tags/v})" >> $GITHUB_ENV
- uses: actions/checkout@v2
- name: Delete tag
uses: prompt/actions-delete-tag@v1
- name: Delete tag local
run: git tag -d ${{ env.TAG_NAME }}
- name: Inject version into setup.py
run: |
sed -i "s/version=\".*\"/version=\"${{ env.TAG_VERSION }}\"/" streamdal/__init__.py
sed -i "s/version=.*/version='${{ env.TAG_VERSION }}',/" setup.py
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Bumped version in setup.py to ${{ env.TAG_VERSION }}
branch: main
tagging_message: ${{ env.TAG_NAME }}
push_options: '--force'
- name: Generate updated distribution
run: |
python3 setup.py sdist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Create tag
uses: mathieudutour/[email protected]
id: create_tag
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
37 changes: 15 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,24 @@ python -m pip install streamdal
import pprint
from streamdal import (OPERATION_TYPE_CONSUMER, ProcessRequest, StreamdalClient, StreamdalConfig)


def main():
client = StreamdalClient(
cfg=StreamdalConfig(
service_name="order-ingest",
dry_run=True,
streamdal_url="streamdal-server.dev.svc.cluster.local:8082",
streamdal_token="1234",
)
client = StreamdalClient(
cfg=StreamdalConfig(
service_name="order-ingest",
streamdal_url="streamdal-server.svc.cluster.local:8082",
streamdal_token="1234",
)

res = client.process(
ProcessRequest(
operation_type=OPERATION_TYPE_CONSUMER,
operation_name="new-order-topic",
component_name="kafka",
data=b'{"object": {"field": true}}',
)
)

res = client.process(
ProcessRequest(
operation_type=OPERATION_TYPE_CONSUMER,
operation_name="new-order-topic",
component_name="kafka",
data=b'{"object": {"field": true}}',
)
)

pprint.pprint(res)


if __name__ == "__main__":
main()
pprint.pprint(res)
```

### Metrics
Expand Down

0 comments on commit 092d016

Please sign in to comment.