Skip to content

Commit

Permalink
Make "publish" job in Actions to need the "build" as finished (#388)
Browse files Browse the repository at this point in the history
The `publish` job now requires that the `build` job should be finished
before starting. This solves the issue of the `publish` job not finding
the uploaded artifact. Update the versions of the `upload-artifacts` and
`download-artifacts` to v3 in `pypi.yml`.
  • Loading branch information
santisoler committed Mar 2, 2023
1 parent 3dd77c1 commit 941e3bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
- name: Upload HTML documentation as an artifact
# Only if not a pull request
if: success() && github.event_name != 'pull_request'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: docs-${{ github.sha }}
path: doc/_build/html
Expand All @@ -148,7 +148,7 @@ jobs:

# Fetch the built docs from the "build" job
- name: Download HTML documentation artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: docs-${{ github.sha }}
path: doc/_build/html
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
- name: Upload archives as artifacts
# Only if not a pull request
if: success() && github.event_name != 'pull_request'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: pypi-${{ github.sha }}
path: dist
Expand All @@ -88,6 +88,7 @@ jobs:
# Publish built wheels and source archives to PyPI and test PyPI
publish:
runs-on: ubuntu-latest
needs: build
# Only publish from the origin repository, not forks
if: github.repository_owner == 'fatiando' && github.event_name != 'pull_request'

Expand All @@ -100,7 +101,7 @@ jobs:
persist-credentials: false

- name: Download built source and wheel packages
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: pypi-${{ github.sha }}
path: dist
Expand Down

0 comments on commit 941e3bb

Please sign in to comment.