PyO3/maturin-action

What is the accepted way to pass in absolute paths as the working directory?

Swandog opened this issue · 1 comments

I have a build that is failing from the new changes to how workdir is failing. The relevant piece of my workflow file is this:

      - uses: actions/download-artifact@v3
        id: download-wheels
        with:
          name: wheels
          path: wheels
      - name: Publish to PyPI
        uses: PyO3/maturin-action@v1
        env:
          MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
        with:
          working-directory: ${{steps.download-wheels.outputs.download-path}}
          command: upload
          args: --skip-existing *

Basically, prior steps build the wheels, then upload them using upload-artifact. Then, if I'm publishing, I use download-artifact to download all the wheels, and then maturin-action to upload all of them, by specifying working-directory as equal to the directory that download-artifact downloaded the files to.

The problem I ran into is this:

Error: ENOENT: no such file or directory, chdir '/home/runner/work/lace/lace' -> '/home/runner/work/lace/lace/home/runner/work/lace/lace/wheels'
    at process.wrappedChdir [as chdir] (node:internal/bootstrap/switches/does_own_process_state:112:14)
    at hostBuild (/home/runner/work/_actions/PyO3/maturin-action/v1/dist/index.js:12029:25)

Essentially, the value output by download-artifact is an absolute path. maturin-action.working-directory used to use the absolute path as-is, but now it appends it to GITHUB_WORKSPACE, which causes it to look for a completely non-existent directory, as you see above.

I can probably do some work to calculate the path of ${{steps.download-wheels.outputs.download-path}} relative to $GITHUB_WORKSPACE, but it would be nice if I could use the absolute path as is. The GitHub Docs tell me I can't set the $GITHUB_WORKSPACE; is there another way to specify an absolute path?

Should be fixed in #223.