Skip to content

feat: Command autosuggestion and completion engine (#1) #35

feat: Command autosuggestion and completion engine (#1)

feat: Command autosuggestion and completion engine (#1) #35

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
pypi-release:
name: Publish to PyPI
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write # Mandatory for Trusted Publishing (OIDC)
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Set up Python
run: uv python install 3.11
- name: Verify Version Consistency
run: |
PYTHON_VERSION=$(uv run python -c 'import niyam; print(f"v{niyam.__version__}")')
TAG_VERSION=${{ github.ref_name }}
if [ "$PYTHON_VERSION" != "$TAG_VERSION" ]; then
echo "Error: Version in niyam/__init__.py ($PYTHON_VERSION) does not match tag ($TAG_VERSION)"
exit 1
fi
- name: Build package
run: uv build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
build-binaries:
name: Build Standalone Binaries
runs-on: ${{ matrix.os }}
permissions:
id-token: write
attestations: write
contents: read
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Set up Python
run: uv python install 3.11
- name: Install PyInstaller and Niyam
run: |
uv venv
uv pip install pyinstaller .
- name: Build with PyInstaller
run: |
uv run pyinstaller --onefile --name niyam niyam/__main__.py
- name: Install Syft (Unix)
if: matrix.os != 'windows-latest'
run: curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
- name: Install Syft (Windows)
if: matrix.os == 'windows-latest'
run: |
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.ps1 | pwsh -Command -
- name: Generate SBOM
run: |
syft dist/ -o spdx-json=dist/sbom-${{ matrix.os }}.spdx.json
continue-on-error: true
- name: Attest Build Provenance
uses: actions/attest-build-provenance@v1
with:
subject-path: 'dist/niyam*'
continue-on-error: true
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: niyam-${{ matrix.os }}
path: dist/niyam*
create-release:
name: Create GitHub Release
needs: [pypi-release, build-binaries]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/niyam-ubuntu-latest/niyam
artifacts/niyam-macos-latest/niyam
artifacts/niyam-windows-latest/niyam.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}