Skip to content

feat: add ci/cd workflow for the algod api clients #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 15, 2025
Merged
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
42 changes: 42 additions & 0 deletions .github/actions/as-python-version/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Convert to Python Version
description: Converts a semantic version to Python PEP 440 format
inputs:
version:
description: The semantic version to convert
required: true
outputs:
version:
description: The version in Python PEP 440 format
value: ${{ steps.convert_version.outputs.version }}
runs:
using: "composite"
steps:
- id: convert_version
shell: bash
run: |
NPMVER="${{ inputs.version }}"
# Convert common prerelease formats
# 1.2.3-alpha.1 -> 1.2.3a1
# 1.2.3-beta.2 -> 1.2.3b2
# 1.2.3-rc.1 -> 1.2.3rc1
if [[ $NPMVER =~ ^([0-9]+\.[0-9]+\.[0-9]+)-([a-z]+)\.([0-9]+)$ ]]; then
PREFIX=${BASH_REMATCH[1]}
TYPE=${BASH_REMATCH[2]}
NUM=${BASH_REMATCH[3]}
if [[ $TYPE == "alpha" ]]; then
PYVER="${PREFIX}a${NUM}"
elif [[ $TYPE == "beta" ]]; then
PYVER="${PREFIX}b${NUM}"
elif [[ $TYPE == "rc" ]]; then
PYVER="${PREFIX}rc${NUM}"
else
# Handle other prerelease designations as dev releases
PYVER="${PREFIX}.dev${NUM}"
fi
else
# If it's a simple version like 1.2.3, use as-is
PYVER="$NPMVER"
fi
echo "version=$PYVER" >> $GITHUB_OUTPUT
125 changes: 0 additions & 125 deletions .github/workflows/api_clients_ci.yml

This file was deleted.

42 changes: 39 additions & 3 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ jobs:
outputs:
# The packages that use Uniffi bindings
ffi_packages: ${{ steps.set_ffi_packages.outputs.ffi_packages }}
# The API client packages
api_packages: ${{ steps.set_api_packages.outputs.api_packages }}
steps:
- id: set_ffi_packages
run: echo 'ffi_packages=["algokit_transact"]' >> $GITHUB_OUTPUT
- id: set_api_packages
run: echo 'api_packages=["algod_api"]' >> $GITHUB_OUTPUT

typescript_wasm_ci_cd:
concurrency: ${{ github.event_name == 'push' && format('cd-{0}', github.ref) || format('ci-typescript_wasm-{0}', github.run_id) }}
needs: setup
uses: ./.github/workflows/typescript_wasm_ci_cd.yml
strategy:
Expand All @@ -32,10 +35,12 @@ jobs:
secrets:
BOT_ID: ${{ secrets.BOT_ID }}
BOT_SK: ${{ secrets.BOT_SK }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This is used because the GitHub NPM package registry doesn't support GitHub App tokens

python_uniffi_ci_cd:
concurrency: ${{ github.event_name == 'push' && format('cd-{0}', github.ref) || format('ci-python_uniffi-{0}', github.run_id) }}
needs: setup
needs:
- setup
- typescript_wasm_ci_cd
uses: ./.github/workflows/python_uniffi_ci_cd.yml
strategy:
matrix:
Expand All @@ -46,3 +51,34 @@ jobs:
secrets:
BOT_ID: ${{ secrets.BOT_ID }}
BOT_SK: ${{ secrets.BOT_SK }}

typescript_api_ci_cd:
needs:
- setup
- python_uniffi_ci_cd
uses: ./.github/workflows/typescript_api_client_ci_cd.yml
strategy:
matrix:
api: ${{ fromJSON(needs.setup.outputs.api_packages) }}
with:
api: ${{ matrix.api }}
release: ${{ github.event_name == 'push' }}
secrets:
BOT_ID: ${{ secrets.BOT_ID }}
BOT_SK: ${{ secrets.BOT_SK }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This is used because the GitHub NPM package registry doesn't support GitHub App tokens

python_api_ci_cd:
needs:
- setup
- typescript_api_ci_cd
uses: ./.github/workflows/python_api_client_ci_cd.yml
strategy:
matrix:
api: ${{ fromJSON(needs.setup.outputs.api_packages) }}
with:
api: ${{ matrix.api }}
release: ${{ github.event_name == 'push' }}
secrets:
BOT_ID: ${{ secrets.BOT_ID }}
BOT_SK: ${{ secrets.BOT_SK }}
Loading