Skip to content

Latest commit

 

History

History
71 lines (46 loc) · 2.14 KB

2.build-publish.md

File metadata and controls

71 lines (46 loc) · 2.14 KB

🚀 Build and Publish

Overview

This GitHub Action automates the process of building and publishing the project. It triggers automatically after a version bump or when a tag (v*.*.*) is pushed. The workflow builds the package and optionally publishes it to a package registry.

How It Works

The workflow runs in the following scenarios:

  • After Bump Version workflow completes.
  • When a new tag (v*.*.*) is pushed to the repository.

Workflow Configuration

Trigger

  • Triggered by:
    • Completion of 1. Bump Version workflow.
    • Push event on tags matching v*.*.*.

Jobs

1. Build and Publish

This job builds the package and creates a release.

  • Runs on: ubuntu-22.04
  • Permissions: contents: write
  • Steps:
    1. Checkout the repository
    2. Set up Python 3.9
    3. Install dependencies (from requirements/requirements.build.txt)
    4. Build the package using ./scripts/build.sh -c
    5. Create a release using GitHub CLI (gh release create)

Usage

This workflow runs automatically when a new version is tagged. However, you can manually trigger a tag and push it:

  1. Bump the version using the 1. Bump Version workflow.

  2. Create a tag manually and push it:

    git tag v1.2.3
    git push origin v1.2.3
  3. The workflow will build and publish the package.

Environment Variables

  • GITHUB_TOKEN: Used for creating GitHub releases.
  • PYPI_API_TOKEN (if enabled): Used for publishing packages to PyPI.

Scripts Used

  • build.sh: Builds the package.
  • get-version.sh: Retrieves the current version.

Notes

  • This workflow supports both GitHub Releases and optional package publishing.
  • Ensure build.sh is executable and correctly configured.
  • If the workflow fails, check logs for errors related to dependencies or authentication.

Troubleshooting

  • If the build step fails, ensure dependencies are correctly installed.
  • If release creation fails, verify that GITHUB_TOKEN has the necessary permissions.
  • If publishing to PyPI fails, check that the API token is correctly set up in repository secrets.