Skip to content

Commit 30c777d

Browse files
committed
fix: race condition during cache retrieval
1 parent c66082f commit 30c777d

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/_build-package.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
4141
TAG=${GITHUB_REF#refs/*/}
4242
sed -i -e "s/0.0.0/${TAG#v}/" pyproject.toml
43+
echo "Version detected as ${TAG#v}"
4344
fi
4445
4546
- name: Build package
@@ -74,7 +75,7 @@ jobs:
7475
path: |
7576
dist/prolif-*.whl
7677
dist/prolif-*.tar.gz
77-
key: prolif-${{ runner.os }}-${{ github.sha }}
78+
key: prolif-${{ runner.os }}-${{ github.sha }}-${{ github.ref_type }}
7879

7980
- name: Expose package as artifact
8081
if: inputs.upload-package
@@ -114,7 +115,7 @@ jobs:
114115
path: |
115116
dist/prolif-*.whl
116117
dist/prolif-*.tar.gz
117-
key: prolif-${{ runner.os }}-${{ github.sha }}
118+
key: prolif-${{ runner.os }}-${{ github.sha }}-${{ github.ref_type }}
118119

119120
- name: Install from tar.gz
120121
run: |

.github/workflows/build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,22 @@ jobs:
2424
publish:
2525
name: Publish to PyPI
2626
runs-on: ubuntu-latest
27+
needs: [build]
2728
steps:
29+
2830
- name: Retrieve cached package
2931
uses: actions/cache/restore@v3
3032
id: cache-prolif
3133
with:
3234
path: |
3335
dist/prolif-*.whl
3436
dist/prolif-*.tar.gz
35-
key: prolif-${{ runner.os }}-${{ github.sha }}
37+
key: prolif-${{ runner.os }}-${{ github.sha }}-${{ github.ref_type }}
38+
fail-on-cache-miss: true
39+
40+
- name: List output
41+
run: |
42+
ls -lah dist/*
3643
3744
- name: Publish to PyPI
3845
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)