🚀 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 Versionworkflow.
- Push event on tags matching v*.*.*.
 
- Completion of 
Jobs
1. Build and Publish
This job builds the package and creates a release.
- Runs on: ubuntu-24.04
- Permissions: contents: write
- Steps:- Checkout the repository
- Install dependencies (from requirements/requirements.build.txt)
- Build the package using ./scripts/build.sh -c
- 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:
- Bump the version using the 1. Bump Versionworkflow.
- 
Create a tag manually and push it: 
- 
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.shis 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_TOKENhas the necessary permissions.
- If publishing to PyPI fails, check that the API token is correctly set up in repository secrets.