Skip to content

Commit

Permalink
feat: add auto-publishing support (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
dogun-anduril authored Nov 21, 2024
1 parent 252843e commit 364910c
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 43 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/automerge.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/release.yml
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
10 changes: 10 additions & 0 deletions .releaserc.yml
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}"
},
]
]
Empty file added LICENSE
Empty file.
37 changes: 26 additions & 11 deletions pyproject.toml
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']
1 change: 1 addition & 0 deletions src/__about__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.0.0.dev"

0 comments on commit 364910c

Please sign in to comment.