-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add auto-publishing support (#11)
- Loading branch information
1 parent
252843e
commit 364910c
Showing
6 changed files
with
102 additions
and
43 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Release | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # to be able to publish a GitHub release | ||
issues: write # to be able to comment on released issues | ||
pull-requests: write # to be able to comment on released pull requests | ||
id-token: write # to enable use of OIDC for npm provenance | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install hatch | ||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v4 | ||
with: | ||
semantic_version: 24.2.0 | ||
extra_plugins: | | ||
@semantic-release/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build package | ||
run: hatch build | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
publish: | ||
name: Publish distribution to PyPI | ||
needs: | ||
- release | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/anduril-lattice-sdk # Replace <package-name> with your PyPI project name | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
plugins: [ | ||
"@semantic-release/commit-analyzer", | ||
'@semantic-release/release-notes-generator', | ||
"@semantic-release/github", | ||
[ | ||
"@semantic-release/exec", { | ||
"prepareCmd": "hatch version ${nextRelease.version}" | ||
}, | ||
] | ||
] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,40 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[template.plugins.default] | ||
src-layout = true | ||
|
||
[project] | ||
name = "anduril" | ||
version = "1.0" | ||
name = "anduril-lattice-sdk" | ||
dynamic = [ | ||
"version", | ||
] | ||
dependencies = [ | ||
"betterproto>=2.0.0b6", | ||
"betterproto>=2.0.0b7", | ||
"grpcio", | ||
"grpclib", | ||
"protobuf" | ||
] | ||
license = {file = "LICENSE"} | ||
requires-python = ">=3.8" | ||
authors = [ | ||
{name = "Anduril Industries Inc."}, | ||
] | ||
maintainers = [ | ||
{name = "Anduril Industries Inc."} | ||
] | ||
description = "Anduril SDK in Python" | ||
description = "Anduril Lattice SDK in Python" | ||
readme = "README.md" | ||
keywords = ["anduril", "lattice", "sdk"] | ||
|
||
[project.urls] | ||
Homepage = "https://anduril.com" | ||
Documentation = "https://docs.anduril.com" | ||
Repository = "https://github.com/anduril/lattice-sdk-python" | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[tool.hatch.version] | ||
path = "src/__about__.py" | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["src/anduril"] | ||
|
||
[tool.hatch.build.targets.sdist] | ||
exclude = ['.github'] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "0.0.0.dev" |