fix: pyproject package directory #25
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
name: Release to Artifact Registry | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
release: | |
types: [published] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: 'write' | |
id-token: 'write' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11.5 | |
- id: auth | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: "${{ secrets.ARTIFACT_REGISTRY_KEY }}" | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v2 | |
# - name: Display gcloud info | |
# run: gcloud info | |
- name: Install and configure Poetry | |
uses: snok/install-poetry@v1 | |
- name: Configure deploy keys | |
run: | | |
# poetry self add poetry-dynamic-versioning[plugin] | |
# poetry config pypi-token.pypi ${{ secrets.PYPI_API_KEY }} | |
poetry self add keyrings.google-artifactregistry-auth | |
poetry config repositories.gcp https://us-west1-python.pkg.dev/probcomp-caliban/probcomp/ | |
- name: Install deps | |
run: poetry install | |
- name: Get current date and time | |
id: datetime | |
run: | | |
echo "NEXT_VERSION=$(date +'%Y.%m.%d.%H%M.%S')" >> $GITHUB_ENV | |
- name: Update version in pyproject.toml | |
run: | | |
poetry version ${{ env.NEXT_VERSION }} | |
- name: Create Git tag | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git tag -a "v${{ env.NEXT_VERSION }}" -m "Release version ${{ env.NEXT_VERSION }}" | |
git push origin --tags | |
- name: Deploy to Artifact Registry | |
run: poetry publish --build --repository gcp |