Skip to content

Merge pull request #56 from StirNetwork/patch-feat/#40 #15

Merge pull request #56 from StirNetwork/patch-feat/#40

Merge pull request #56 from StirNetwork/patch-feat/#40 #15

Workflow file for this run

# SPDX-FileCopyrightText: 2025 Ethersecurity Inc.
#
# SPDX-License-Identifier: MPL-2.0
# Author: Shohei KAMON <cameong@stir.network>
name: Publish to PyPI
on:
push:
tags:
- 'v*' # Trigger on any tag push
workflow_dispatch:
jobs:
build-and-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel build twine
- name: Check version format
id: check_version
run: |
if [[ "${GITHUB_REF##*/}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Valid version tag detected: ${GITHUB_REF##*/}"
echo "VERSION_VALID=true" >> $GITHUB_ENV
else
echo "Invalid version tag detected: ${GITHUB_REF##*/}"
echo "VERSION_VALID=false" >> $GITHUB_ENV
fi
- name: Build for PyPI
run: |
python -m build
- name: publish to PyPI
if: env.VERSION_VALID == 'true'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload --repository pypi dist/*
- name: Generate SHA256
run: |
sha256sum dist/*.tar.gz > dist/fireblocks-cli-${GITHUB_REF##*/}.tar.gz.sha256
- name: Upload Release Assets to GitHub
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: |
dist/*.tar.gz
dist/*.tar.gz.sha256
generate_release_notes: true
create_release: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}