diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 408e8396c..4e3025e56 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,10 @@ on: version: description: 'Version' required: true + current_release: + description: 'True to release Docker and update version info in moto/__init__.py' + required: true + type: boolean jobs: release-moto-job: @@ -44,9 +48,11 @@ jobs: - name: Build Python run: python -m build - name: Build Docker release + if: ${{ inputs.current_release }} run: | docker build -t motoserver/moto . --tag moto:${{ env.VERSION }} - name: Test Docker release + if: ${{ inputs.current_release }} run: | docker run -p 5000:5000 --name moto motoserver/moto & TEST_SERVER_MODE=true pytest -sv tests/test_core tests/test_s3/test_s3.py @@ -66,21 +72,26 @@ jobs: # Required to get the correct Digest # See https://github.com/docker/build-push-action/issues/461 - name: Set up QEMU + if: ${{ inputs.current_release }} uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx + if: ${{ inputs.current_release }} uses: docker/setup-buildx-action@v3 - name: Login to DockerHub + if: ${{ inputs.current_release }} uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GHCR + if: ${{ inputs.current_release }} uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Push to DockerHub and GHCR + if: ${{ inputs.current_release }} id: build_and_push uses: docker/build-push-action@v5 with: @@ -90,6 +101,7 @@ jobs: motoserver/moto:${{ env.VERSION }} ghcr.io/getmoto/motoserver:${{ env.VERSION }} - name: Increase patch version number + if: ${{ inputs.current_release }} run: | python update_version_from_git.py patch sed -i 's/Docker Digest for ${{ env.VERSION }}: /Docker Digest for ${{ env.VERSION }}: _${{ steps.build_and_push.outputs.digest }}_/' CHANGELOG.md