after the working version #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | Semantic Release | |
on: | |
workflow_dispatch: | |
inputs: | |
dry_run: | |
description: 'Dry run (no changes will be committed)' | |
type: boolean | |
default: false | |
debug: | |
description: 'Enable verbose debugging output' | |
type: boolean | |
default: false | |
push: | |
branches: | |
- '**' | |
paths-ignore: | |
- 'docs/**' | |
- '*.md' | |
- '.github/workflows/deploy-pypi-packages.yaml' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
concurrency: release | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set run mode | |
id: set_mode | |
shell: bash | |
run: | | |
IS_DRY_RUN=$([ "${{ github.event_name }}" = "push" ] || [ "${{ inputs.dry_run }}" = "true" ] && echo "true" || echo "false") | |
echo "is_dry_run=$IS_DRY_RUN" >> $GITHUB_OUTPUT | |
echo "Mode: $([ "$IS_DRY_RUN" = "true" ] && echo "Dry run" || echo "Full release")" | |
- name: Python Release - Dry Run | |
id: release_dryrun | |
if: steps.set_mode.outputs.is_dry_run == 'true' | |
uses: python-semantic-release/python-semantic-release@v9.20.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
push: "false" | |
commit: "false" | |
tag: "false" | |
changelog: "false" | |
root_options: ${{ inputs.debug && '-vv --noop' || '-v --noop' }} | |
- name: Python Release | |
id: release | |
if: ${{ github.event_name == 'workflow_dispatch' && !inputs.dry_run }} | |
uses: python-semantic-release/python-semantic-release@v9.20.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
push: "true" | |
changelog: "true" | |
root_options: ${{ inputs.debug && '-vv' || '-v' }} | |
- name: Create Step Summary | |
shell: bash | |
run: | | |
IS_DRY_RUN="${{ steps.set_mode.outputs.is_dry_run }}" | |
RELEASE_ID=$([ "$IS_DRY_RUN" = "true" ] && echo "release_dryrun" || echo "release") | |
WAS_RELEASED=$([ "${{ steps.release_dryrun.outputs.released || steps.release.outputs.released }}" = "true" ] && echo "Yes" || echo "No") | |
VERSION="${{ steps.release_dryrun.outputs.version || steps.release.outputs.version }}" | |
TAG="${{ steps.release_dryrun.outputs.tag || steps.release.outputs.tag }}" | |
# Display trigger information | |
if [ "${{ github.event_name }}" = "push" ]; then | |
TRIGGER_INFO="Triggered by push to branch: ${{ github.ref_name }}" | |
else | |
TRIGGER_INFO="Triggered manually via workflow dispatch" | |
fi | |
# Create warning text for dry run | |
if [ "$IS_DRY_RUN" = "true" ]; then | |
DRY_RUN_TEXT="⚠️ This is a dry run - no changes were committed" | |
TITLE_SUFFIX=" (Dry Run)" | |
else | |
DRY_RUN_TEXT="" | |
TITLE_SUFFIX="" | |
fi | |
cat > $GITHUB_STEP_SUMMARY << EOF | |
# MQPy Release$TITLE_SUFFIX | |
## Release Summary | |
$TRIGGER_INFO | |
$DRY_RUN_TEXT | |
Current/Next Version: $VERSION | |
Current/Next Tag: $TAG | |
Release required: $WAS_RELEASED | |
## Installation Instructions | |
### Important Warning ⚠️ | |
**IMPORTANT: Trading involves substantial risk of loss and is not suitable for all investors.** | |
- Always use a **demo account** with fake money when testing strategies | |
- MQPy is provided for **educational purposes only** | |
- Past performance is not indicative of future results | |
- Never trade with money you cannot afford to lose | |
- The developers are not responsible for any financial losses | |
### Windows-Only Compatibility | |
This package is designed to work exclusively on Windows operating systems. | |
### Installation Steps | |
#### $([ "$IS_DRY_RUN" = "true" ] && echo "Test/RC Version" || echo "Production Version") | |
$([ "$IS_DRY_RUN" = "true" ] && echo "This is a release candidate version published to Test PyPI. | |
\`\`\` | |
pip install mqpy==$VERSION --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ | |
\`\`\`" || echo "\`\`\` | |
pip install mqpy==$VERSION | |
\`\`\`") | |
### Documentation | |
For complete documentation, visit our [GitHub repository](https://github.com/Joaopeuko/Mql5-Python-Integration). | |
EOF |