name: Release on: workflow_dispatch: inputs: version: description: 'Version' required: true jobs: release-moto-job: runs-on: ubuntu-latest name: Release Moto env: VERSION: 0.0.0 steps: - name: Set Env run: | echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV - uses: actions/checkout@v2 with: fetch-depth: 0 - name: Set up Python 3.8 uses: actions/setup-python@v2 with: python-version: 3.8 - name: Install dependencies run: | python -m pip install --upgrade pip pip install wheel setuptools packaging twine --upgrade - name: Verify Tag does not exist run: | ! git rev-parse ${{ env.VERSION }} || { echo "Ensure that no tag exists for ${{ env.VERSION }}" ; exit 1; } - name: Verify supplied version exists in the CHANGELOG run: | grep ${{ env.VERSION }} CHANGELOG.md || { echo "Ensure that the CHANGELOG contains an entry for ${{ env.VERSION }}" ; exit 1; } - name: Set version number run: python update_version_from_git.py ${{ env.VERSION }} - name: Build run: python setup.py sdist bdist_wheel - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@master with: password: ${{ secrets.PYPI_API_TOKEN }} - name: Tag version on Github run: | git tag ${{ env.VERSION }} git push origin ${{ env.VERSION }} - name: Build Docker release run: | docker build -t motoserver/moto . --tag moto:${{ env.VERSION }} - name: Login to DockerHub uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v2 with: push: true tags: motoserver/moto:${{ env.VERSION }} - name: Increase patch version number run: | python update_version_from_git.py patch git config --local user.email "admin@getmoto.org" git config --local user.name "Moto Admin" git add moto/__init__.py git commit -m "Increase version number post-release" git push