Skip to content

fix: Patch version directly in meson.build before building #69

fix: Patch version directly in meson.build before building

fix: Patch version directly in meson.build before building #69

Workflow file for this run

name: Make source distribution
on: ['push', 'pull_request']
jobs:
make_sdist:
name: Make source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-dev
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Get version from git tag
id: version
run: |
VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Building version: $VERSION"
- name: Patch version in meson.build
run: |
sed -i "s/version: '0.0.0'/version: '${{ steps.version.outputs.version }}'/" meson.build
cat meson.build | head -5
- name: Build source distribution
run: |
pip install build
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz