File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434 rm -rf dist
3535 python -m build --wheel
3636
37- WHEEL_PATH=$(ls dist/*.whl)
38- WHEEL_VERSION=$(python - <<'PY'
39- from pathlib import Path
40-
41- wheel = next(Path("dist").glob("*.whl")).name
42- print(wheel.split("-")[1].replace("_", "-"))
43- PY
44- )
37+ WHEEL_VERSION=$(python -c 'from pathlib import Path; wheel = next(Path("dist").glob("*.whl")).name; print(wheel.split("-")[1].replace("_", "-"))')
4538
4639 if [ "$WHEEL_VERSION" != "$RELEASE_TAG" ]; then
4740 echo "Wheel version $WHEEL_VERSION does not match release tag $RELEASE_TAG"
Original file line number Diff line number Diff line change 5151 - name : Determine compose-runner version and Docker tags
5252 id : version
5353 run : |
54- VERSION=$(python - <<'PY'
55- from pathlib import Path
56-
57- wheel = next(Path("dist").glob("*.whl")).name
58- print(wheel.split("-")[1].replace("_", "-"))
59- PY
60- )
61- DOCKER_TAG="${VERSION//+/-}"
54+ VERSION=$(python -c 'from pathlib import Path; wheel = next(Path("dist").glob("*.whl")).name; print(wheel.split("-")[1].replace("_", "-"))')
55+ DOCKER_TAG=$(printf '%s' "$VERSION" | tr '+' '-')
6256
6357 if [[ "${GITHUB_REF_TYPE}" == "tag" && "${GITHUB_REF_NAME}" != "${VERSION}" ]]; then
6458 echo "Wheel version ${VERSION} does not match git tag ${GITHUB_REF_NAME}"
6761
6862 echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
6963 echo "docker_tag=${DOCKER_TAG}" >> "$GITHUB_OUTPUT"
64+ {
65+ echo "tags<<EOF"
66+ echo "ghcr.io/neurostuff/nsc-runner:${DOCKER_TAG}"
67+ if [[ "${GITHUB_REF_NAME}" == "main" ]]; then
68+ echo "ghcr.io/neurostuff/nsc-runner:latest"
69+ fi
70+ echo "EOF"
71+ } >> "$GITHUB_OUTPUT"
7072
7173 - name : Build and push Docker image
7274 uses : docker/build-push-action@v7
7577 push : true
7678 build-args : |
7779 COMPOSE_RUNNER_VERSION=${{ steps.version.outputs.version }}
78- tags : |
79- ghcr.io/neurostuff/nsc-runner:${{ steps.version.outputs.docker_tag }}
80- ghcr.io/neurostuff/nsc-runner:${{ github.ref_name == 'main' && 'latest' || steps.version.outputs.docker_tag }}
80+ tags : ${{ steps.version.outputs.tags }}
You can’t perform that action at this time.
0 commit comments