diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7c4c01d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,89 @@ +name: Release Pipeline + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} + upload_url: ${{ steps.release.outputs.upload_url }} + steps: + - uses: google-github-actions/release-please-action@v4 + id: release + with: + # Token for creating PRs and releases + token: ${{ secrets.GITHUB_TOKEN }} + + build-package: + name: Build Python Package + needs: release-please + if: ${{ needs.release-please.outputs.release_created == 'true' }} + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install build dependencies + run: python -m pip install build + + - name: Build sdist and wheel + run: python -m build + + - name: Store distribution packages + uses: actions/upload-artifact@v7 + with: + name: python-package-distributions + path: dist/ + + publish-github-release: + name: Attach to GitHub Release + needs: [release-please, build-package] + runs-on: ubuntu-latest + permissions: + contents: write # Needed to upload release assets + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Download distribution packages + uses: actions/download-artifact@v8 + with: + name: python-package-distributions + path: dist/ + + - name: Attach artifacts to GitHub Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release upload ${{ needs.release-please.outputs.tag_name }} dist/* + + publish-pypi: + name: Publish to PyPI + needs: [release-please, build-package] + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write # Needed for trusted publishing to PyPI + steps: + - name: Download distribution packages + uses: actions/download-artifact@v8 + with: + name: python-package-distributions + path: dist/ + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..96d9691 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.1.0" +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..d318590 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog + +All notable changes to this project are documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +This file is maintained automatically by +[release-please](https://github.com/googleapis/release-please) based on +[Conventional Commits](https://www.conventionalcommits.org/). diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..f072958 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,62 @@ +{ + "release-type": "python", + "package-name": "datavault4sqlglot", + "include-component-in-tag": false, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "changelog-sections": [ + { + "type": "feat", + "section": "Features", + "hidden": false + }, + { + "type": "fix", + "section": "Bug Fixes", + "hidden": false + }, + { + "type": "docs", + "section": "Documentation", + "hidden": false + }, + { + "type": "style", + "section": "Code Style", + "hidden": false + }, + { + "type": "refactor", + "section": "Refactoring", + "hidden": false + }, + { + "type": "perf", + "section": "Performance", + "hidden": false + }, + { + "type": "test", + "section": "Tests", + "hidden": false + }, + { + "type": "build", + "section": "Build System", + "hidden": false + }, + { + "type": "ci", + "section": "CI/CD", + "hidden": false + }, + { + "type": "chore", + "section": "Miscellaneous", + "hidden": false + } + ], + "packages": { + ".": {} + } +}