Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Update env var name for Poetry PyPI token #62

Merged
merged 4 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ permissions:

jobs:
build-docs:
name: Build Docs
sfriedowitz marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest

steps:
- name: Checkout code
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Python 3.10
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:
- "**"

jobs:
all_tests:
pr-checks:
name: PR Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -19,13 +20,13 @@ jobs:
with:
python-version: "3.10"

- name: get ruff version
- name: Get Ruff Version
id: get_ruff_version
uses: mikefarah/yq@master
with:
cmd: yq -oy '.tool.poetry.dev-dependencies.ruff' pyproject.toml

- name: Install UV, venv, ruff
- name: Install uv, venv, Ruff
id: setup
env:
RUFF_VERSION: ${{ steps.get_ruff_version.outputs.result }}
Expand All @@ -43,7 +44,7 @@ jobs:
ruff --output-format=github .
continue-on-error: false

- name: Install Poetry and package
- name: Install Poetry and Package
id: install_poetry_and_deps
run: |
. .venv/bin/activate
Expand All @@ -52,14 +53,14 @@ jobs:
poetry install
continue-on-error: false

- name: Unit tests
- name: Unit Tests
id: unit_tests
run: |
. .venv/bin/activate
poetry run pytest tests/unit
continue-on-error: false

- name: Integration tests
- name: Integration Tests
id: integration_tests
run: |
. .venv/bin/activate
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and publish to PyPI
name: Build and Publish to PyPI

on:
workflow_dispatch:
Expand All @@ -11,14 +11,14 @@ on:
- prod

jobs:
build_dist:
name: Build distribution 📦
build-dist:
name: Build Distribution 📦
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand All @@ -28,7 +28,7 @@ jobs:
uv venv
echo "VIRTUAL_ENV=$HOME/.venv" >> $GITHUB_ENV

- name: Install poetry
- name: Install Poetry
id: setup
run: |
. .venv/bin/activate
Expand All @@ -37,22 +37,22 @@ jobs:
poetry build
continue-on-error: false

- name: Build package
- name: Build Package
id: build_package
run: |
. .venv/bin/activate
poetry build
continue-on-error: false

- name: Archive production artifact
- name: Archive Production Artifact
uses: actions/upload-artifact@v4
id: lmbuddy_artifacts
with:
name: lmbuddy_dists
path: dist/
retention-days: 1

- name: Publish dist to test pypi
- name: Publish to Test PyPI
if: ${{ inputs.prod_or_test == 'test' }}
env:
POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.PYPI_TEST_KEY }}
Expand All @@ -61,9 +61,9 @@ jobs:
poetry publish --repository testpypi
continue-on-error: false

- name: Publish dist to real pypi
- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN: ${{ secrets.PYPI_KEY }}
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_KEY }}
sfriedowitz marked this conversation as resolved.
Show resolved Hide resolved
# only runs full release if we're on main
# tag filter and label filter were already hit
if: ${{ inputs.prod_or_test == 'prod' }}
Expand All @@ -72,23 +72,23 @@ jobs:
poetry publish

github-release:
name: Prepare release
name: Prepare Release
needs:
- build_dist
- build-dist
runs-on: ubuntu-latest
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download artifacts
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: lmbuddy_dists
path: ./dist/
merge-multiple: true

- name: Release draft
- name: Release Draft
uses: softprops/action-gh-release@v1
if: ${{ inputs.prod_or_test == 'test' }}
with:
Expand Down