From 5f8e915e22e7d760ad7b349ab5064cedcf65524b Mon Sep 17 00:00:00 2001 From: Nathaniel van Diepen Date: Wed, 24 Jun 2026 12:35:35 -0600 Subject: [PATCH 1/5] Move pypi update to main workflow as part of normal release, test release logic --- .github/workflows/main.yml | 25 ++++++++++++++++++-- .github/workflows/python-publish.yml | 34 ---------------------------- 2 files changed, 23 insertions(+), 36 deletions(-) delete mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e5f6bb9..7dd80ab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -232,13 +232,12 @@ jobs: # chmod +x ./codexctl # ./codexctl download --hardware rm2 --out /tmp toltec release: - name: Release + name: ${{ github.ref == 'refs/heads/main' && 'Release' || 'Test release' }} needs: - remote - device #- test_device runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' permissions: contents: write steps: @@ -246,6 +245,18 @@ jobs: run: | echo "NAME=$(date +'%Y-%m-%d %H:%M')" >> $GITHUB_ENV echo "TAG=$(date +%s)" >> $GITHUB_ENV + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.13' + - name: Check out repository + uses: actions/checkout@v4 + - name: Install Poetry + run: | + sudo apt-get update + sudo apt-get install libfuse-dev pkg-config + curl -sSL https://install.python-poetry.org | python3 - + echo "$HOME/.local/bin" >> $GITHUB_PATH - uses: actions/download-artifact@v4 with: path: artifacts @@ -257,6 +268,7 @@ jobs: popd done - uses: ncipollo/release-action@v1 + if: github.ref == 'refs/heads/main' with: artifacts: "artifacts/*.zip" name: ${{ env.NAME }} @@ -264,3 +276,12 @@ jobs: commit: ${{ github.sha }} generateReleaseNotes: true makeLatest: true + - name: Update version + run: sed -i "s/^version = \"(.*)\"$/version = \"\1.post$TAG\"/" pyproject.toml + - name: Install dependencies + run: poetry install --no-interaction + - name: Publish to pypi + if: github.ref == 'refs/heads/main' + run: poetry publish --build + env: + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml deleted file mode 100644 index 9379f92..0000000 --- a/.github/workflows/python-publish.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Publish to PyPI - -on: - workflow_dispatch: - release: - types: [published] - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.13' - - - name: Install Poetry - run: | - sudo apt-get update - sudo apt-get install libfuse-dev pkg-config - curl -sSL https://install.python-poetry.org | python3 - - echo "$HOME/.local/bin" >> $GITHUB_PATH - - - name: Install dependencies - run: poetry install --no-interaction - - - name: Build and Publish - env: - # Use a PyPI API Token for security - POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }} - run: poetry publish --build From ada7220e8da1a45f8ff9c49291ed21089dbadb97 Mon Sep 17 00:00:00 2001 From: Nathaniel van Diepen Date: Wed, 24 Jun 2026 12:56:33 -0600 Subject: [PATCH 2/5] Review fixes --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7dd80ab..1c416f7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -254,7 +254,7 @@ jobs: - name: Install Poetry run: | sudo apt-get update - sudo apt-get install libfuse-dev pkg-config + sudo apt-get install -y libfuse-dev pkg-config curl -sSL https://install.python-poetry.org | python3 - echo "$HOME/.local/bin" >> $GITHUB_PATH - uses: actions/download-artifact@v4 @@ -277,7 +277,7 @@ jobs: generateReleaseNotes: true makeLatest: true - name: Update version - run: sed -i "s/^version = \"(.*)\"$/version = \"\1.post$TAG\"/" pyproject.toml + run: sed -iE "s/^version = \"(.*)\"$/version = \"\1.post$TAG\"/" pyproject.toml - name: Install dependencies run: poetry install --no-interaction - name: Publish to pypi From 0be7ab79fac0b29ec32568cdb6f2f5886b7c1cde Mon Sep 17 00:00:00 2001 From: Nathaniel van Diepen Date: Wed, 24 Jun 2026 13:10:36 -0600 Subject: [PATCH 3/5] Fix sed, add debug output --- .github/workflows/main.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1c416f7..ffe6092 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -277,7 +277,9 @@ jobs: generateReleaseNotes: true makeLatest: true - name: Update version - run: sed -iE "s/^version = \"(.*)\"$/version = \"\1.post$TAG\"/" pyproject.toml + run: sed -iE "s/^version = \"(.*)\"$/version = \"\1.post$tag\"/" pyproject.toml + env: + tag: ${{ env.TAG }} - name: Install dependencies run: poetry install --no-interaction - name: Publish to pypi @@ -285,3 +287,10 @@ jobs: run: poetry publish --build env: POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }} + - name: Test output + if: github.ref != 'refs/heads/main' + run: | + echo "name: ${{ env.NAME }}" + echo "tag: ${{ env.TAG }}" + echo "commit: ${{ github.sha }}" + echo "version: $(grep '^version = ' pyproject.toml | cut -d= -f2 | jq -r)" From 2191bd464bce88a983398866f43402658a17d452 Mon Sep 17 00:00:00 2001 From: Nathaniel van Diepen Date: Wed, 24 Jun 2026 13:11:50 -0600 Subject: [PATCH 4/5] Split out package build to always run --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ffe6092..e0211f9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -282,9 +282,11 @@ jobs: tag: ${{ env.TAG }} - name: Install dependencies run: poetry install --no-interaction + - name: Build package + run: poetry build - name: Publish to pypi if: github.ref == 'refs/heads/main' - run: poetry publish --build + run: poetry publish env: POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }} - name: Test output From 949b225f46dbad83b5de4519939b3f8e5f9b8e50 Mon Sep 17 00:00:00 2001 From: Nathaniel van Diepen Date: Wed, 24 Jun 2026 14:30:23 -0600 Subject: [PATCH 5/5] Fix sed in github action... --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e0211f9..43130a9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -277,7 +277,7 @@ jobs: generateReleaseNotes: true makeLatest: true - name: Update version - run: sed -iE "s/^version = \"(.*)\"$/version = \"\1.post$tag\"/" pyproject.toml + run: sed -i -E "s/^version = \"(.*)\"$/version = \"\1.post$tag\"/" pyproject.toml env: tag: ${{ env.TAG }} - name: Install dependencies