diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9eec476..ccb14d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,10 +12,4 @@ jobs: - name: Run release env: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} - run: | - tag=$(echo $REF | cut -d'/' -f3-) - echo "Releasing version ${tag}" - docker build . \ - --target=release_test \ - --build-arg RELEASE_VERSION=${tag} \ - --build-arg PYPI_TOKEN=${PYPI_TOKEN} + run: REF="${{ github.ref }}" ./ci/release.sh diff --git a/Dockerfile b/Dockerfile index 432b9a3..c901a25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,7 +46,7 @@ RUN ./ci/publish.sh FROM base as release_test ARG RELEASE_VERSION ARG RELEASE_DRY_RUN -COPY ./tests /src/tests +COPY ./test /src/test COPY ./ci/run-tests.sh /src/ci/run-tests.sh RUN true && \ ([ "$RELEASE_DRY_RUN" != "true" ] && sleep 90 || true) && \ diff --git a/ci/release.sh b/ci/release.sh new file mode 100755 index 0000000..7b6e260 --- /dev/null +++ b/ci/release.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Run from the project root +cd $(dirname ${BASH_SOURCE[0]})/.. + +# Get the tag for this release +tag=$(echo $REF | cut -d'/' -f3-) + +# Build the docker phase that will release and then test it +docker build . \ + --target=release_test \ + --build-arg RELEASE_VERSION=$tag \ + --build-arg PYPI_TOKEN=${PYPI_TOKEN:-""} \ + --build-arg RELEASE_DRY_RUN=${RELEASE_DRY_RUN:-"false"}