Skip to content

Commit

Permalink
main: Move release script to standalone script
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe-l-hart committed Aug 19, 2021
1 parent 7f457dc commit c9dfd70
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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) && \
Expand Down
14 changes: 14 additions & 0 deletions ci/release.sh
Original file line number Diff line number Diff line change
@@ -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"}

0 comments on commit c9dfd70

Please sign in to comment.