Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish cryptlex.lexactivator package

on:
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- run: git pull origin master --ff-only

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine

- name: Download Native Libs
run: python pre-publish.py

- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

- name: Extract version and create tag
run: |
VERSION=$(sed -n 's/^[[:space:]]*version="\([^"]*\)".*/\1/p' setup.py)

[ -n "$VERSION" ] || exit 1

git tag "$VERSION" 2>/dev/null || echo "Tag already exists"
git push origin "$VERSION" || true

- name: Notify slack releases channel
uses: slackapi/slack-github-action@v2
with:
webhook: ${{ secrets.SLACK_RELEASES_PROD_WEBHOOK_URL }}
webhook-type: webhook-trigger
payload: |
status: "${{ job.status }}"
environment: "PRODUCTION"
project: "LexActivator Python"
44 changes: 44 additions & 0 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Update version

on:
workflow_dispatch:
inputs:
libraryVersion:
description: 'Library Version'
required: true
default: ''
packageVersion:
description: 'Package Version'
required: true
default: ''

jobs:
update-version:
runs-on: ubuntu-latest
env:
LIBRARY_VERSION: ${{ github.event.inputs.libraryVersion }}
PACKAGE_VERSION: ${{ github.event.inputs.packageVersion }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Update Package Version
run: |
sed -i -E 's/^([[:space:]]*)version="[^"]*"/\1version="${{ env.PACKAGE_VERSION }}"/' setup.py

- name: Update Library Version
run: |
sed -i -E 's/^([[:space:]]*lexactivator_libs_version[[:space:]]*=[[:space:]]*)"[^"]*"/\1"v${{ env.LIBRARY_VERSION }}"/' pre-publish.py

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
branch: ci/${{ env.PACKAGE_VERSION }}
title: "chore: bump package version to ${{ env.PACKAGE_VERSION }}"
commit-message: "chore(package version): updated version"
body: |
Automated package version bump.
base: master
add-paths: |
pre-publish.py
setup.py