zed/script/amplitude_release/main.py
Joseph T. Lyons 941f4097fe
Add amplitude release (#1720)
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-10-11 18:25:36 -04:00

30 lines
No EOL
778 B
Python

import datetime
import sys
from amplitude_python_sdk.v2.clients.releases_client import ReleasesAPIClient
from amplitude_python_sdk.v2.models.releases import Release
def main():
version = sys.argv[1]
version = version.removeprefix("v")
api_key = sys.argv[2]
secret_key = sys.argv[3]
current_datetime = datetime.datetime.now(datetime.timezone.utc)
current_datetime = current_datetime.strftime("%Y-%m-%d %H:%M:%S")
release = Release(
title=version,
version=version,
release_start=current_datetime,
created_by="GitHub Release Workflow",
chart_visibility=True
)
ReleasesAPIClient(api_key=api_key, secret_key=secret_key).create(release)
if __name__ == "__main__":
main()