updated license inside pyproject #8
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-onion: | |
| name: Build Onion Binary for ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| artifact_name: onion-linux-x86_64 | |
| - os: macos-14 | |
| artifact_name: onion-darwin-universal | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch full history for setuptools-scm | |
| - name: Install build dependencies | |
| run: | | |
| if [ "$RUNNER_OS" == "Linux" ]; then | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential libsparsehash-dev | |
| elif [ "$RUNNER_OS" == "macOS" ]; then | |
| brew install google-sparsehash | |
| fi | |
| - name: Build Onion | |
| run: | | |
| chmod +x scripts/build_onion.sh | |
| ./scripts/build_onion.sh | |
| - name: Upload Onion Binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact_name }} | |
| path: dalla_data_processing/deduplication/bin/onion-* | |
| if-no-files-found: error | |
| build-wheel: | |
| name: Build universal wheel with all platform binaries | |
| needs: build-onion | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch full history for setuptools-scm | |
| - name: Create bin directory | |
| run: mkdir -p dalla_data_processing/deduplication/bin | |
| - name: Download Linux binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: onion-linux-x86_64 | |
| path: dalla_data_processing/deduplication/bin/ | |
| - name: Download macOS universal binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: onion-darwin-universal | |
| path: dalla_data_processing/deduplication/bin/ | |
| - name: Set binary permissions | |
| run: chmod +x dalla_data_processing/deduplication/bin/onion-* | |
| - name: List all binaries | |
| run: ls -lah dalla_data_processing/deduplication/bin/ | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install build dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine | |
| - name: Build wheel | |
| run: python -m build | |
| - name: List wheel contents | |
| run: | | |
| echo "=== Wheel contents (binaries) ===" | |
| python -m zipfile -l dist/*.whl | grep onion- | |
| echo "=== Wheel info ===" | |
| ls -lh dist/ | |
| - name: Upload wheel | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheel | |
| path: dist/*.whl | |
| build-sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch full history for setuptools-scm | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Build sdist | |
| run: | | |
| pip install build | |
| python -m build --sdist | |
| - name: Upload sdist | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist/*.tar.gz | |
| publish-pypi: | |
| name: Publish to PyPI | |
| needs: [build-wheel, build-sdist] | |
| runs-on: ubuntu-latest | |
| environment: release | |
| steps: | |
| # Download the universal wheel with all platform binaries | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: wheel | |
| path: dist/ | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist/ | |
| - name: List distribution files | |
| run: ls -lh dist/ | |
| - name: Verify wheel integrity | |
| run: | | |
| pip install twine | |
| twine check dist/* | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| skip-existing: true | |
| create-release: | |
| name: Create GitHub Release | |
| needs: [build-wheel, build-sdist] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch full history for setuptools-scm | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: wheel | |
| path: dist/ | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist/ | |
| - name: Extract version from tag | |
| id: version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Generate release notes | |
| id: notes | |
| run: | | |
| # Extract changelog for this version | |
| VERSION=${{ steps.version.outputs.VERSION }} | |
| echo "NOTES<<EOF" >> $GITHUB_OUTPUT | |
| echo "## Dalla Data Processing v${VERSION}" >> $GITHUB_OUTPUT | |
| echo "" >> $GITHUB_OUTPUT | |
| echo "### Installation" >> $GITHUB_OUTPUT | |
| echo "\`\`\`bash" >> $GITHUB_OUTPUT | |
| echo "pip install dalla-data-processing==${VERSION}" >> $GITHUB_OUTPUT | |
| echo "\`\`\`" >> $GITHUB_OUTPUT | |
| echo "" >> $GITHUB_OUTPUT | |
| echo "### What's Changed" >> $GITHUB_OUTPUT | |
| # TODO: Add actual changelog extraction | |
| echo "See CHANGELOG.md for details" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: dist/* | |
| body: ${{ steps.notes.outputs.NOTES }} | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Commented out for now - uncomment when ready to publish Docker images | |
| # build-docker: | |
| # name: Build and Push Docker Image | |
| # needs: [publish-pypi] | |
| # runs-on: ubuntu-latest | |
| # | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # | |
| # - name: Set up Docker Buildx | |
| # uses: docker/setup-buildx-action@v3 | |
| # | |
| # - name: Log in to Docker Hub | |
| # uses: docker/login-action@v3 | |
| # with: | |
| # username: ${{ secrets.DOCKER_USERNAME }} | |
| # password: ${{ secrets.DOCKER_PASSWORD }} | |
| # | |
| # - name: Extract version | |
| # id: version | |
| # run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| # | |
| # - name: Build and push | |
| # uses: docker/build-push-action@v5 | |
| # with: | |
| # context: . | |
| # push: true | |
| # tags: | | |
| # ${{ secrets.DOCKER_USERNAME }}/dalla-data-processing:latest | |
| # ${{ secrets.DOCKER_USERNAME }}/dalla-data-processing:${{ steps.version.outputs.VERSION }} | |
| # cache-from: type=gha | |
| # cache-to: type=gha,mode=max |