diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 8b8a1ff924da..000000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,123 +0,0 @@ -# LocalStack specific workflow to implement a fully-integrated continuous integration pipeline for Moto-Ext -# - Rebase this fork based on the latest commit on `main` of upstream - -name: Sync moto-ext with upstream - -on: - workflow_dispatch: - inputs: - dry_run: - description: 'Dry run' - default: true - required: true - type: boolean - -# Limit concurrency to 1 -concurrency: - group: ${{ github.workflow }} - -jobs: - sync-moto-ext: - runs-on: ubuntu-latest - permissions: - contents: write - id-token: write - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: localstack - persist-credentials: false - - - name: Setup Python - uses: actions/setup-python@v6 - with: - python-version: '3.13' - - - name: Configure Git - run: | - # Configure git - git config --global user.name 'LocalStack Bot' - git config --global user.email 'localstack-bot@users.noreply.github.com' - git remote set-url origin https://git:${{ secrets.PRO_ACCESS_TOKEN }}@github.com/${{ github.repository }} - - # make sure to switch to the `localstack` branch (default / main branch of this fork) - git switch localstack - # add moto upstream as remote - git remote add upstream https://github.com/getmoto/moto.git - # rebase with latest changes - git pull - - # Create a custom merge driver which prefers everything from upstream _BUT_ the name and the URL - mkdir -p $HOME/.local/bin - cat > $HOME/.local/bin/git-prefer-theirs-name-url << EOF - #!/bin/bash - set -e - - base="\$1" - local="\$2" - remote="\$3" - - echo "Executing custom merge driver for base \$base, local \$local, remote \$remote." - - # Define keys to keep - KEYS=("name" "url") - - # Read files into arrays - mapfile -t REMOTE_LINES < "\$remote" - mapfile -t LOCAL_LINES < "\$local" - - echo "merging \$local + \$local + \$remote ..." - - # Function to check if a line should be kept (matches any key) - keep_line() { - local line="\$1" - for key in "\${KEYS[@]}"; do - [[ "\$line" == *"\$key"* ]] && return 0 - done - return 1 - } - - # keep key-matched lines from local, others from remote - for i in "\${!LOCAL_LINES[@]}"; do - if keep_line "\${REMOTE_LINES[i]}"; then - echo "\${REMOTE_LINES[i]}" - else - echo "\${LOCAL_LINES[i]}" - fi - done > "\$local" - - exit 0 - EOF - - # make the script executable and add it to the PATH - chmod +x $HOME/.local/bin/git-prefer-theirs-name-url - echo "$HOME/.local/bin" >> "$GITHUB_PATH" - - # add the merge driver to the git config - cat >> .git/config << EOF - - [merge "git-prefer-theirs-name-url"] - name = A driver which resolves merge conflicts on a setup.cfg such that it always takes the local name and url, and everything else from upstream - driver = git-prefer-theirs-name-url %O %A %B - EOF - - # define to use the custom merge driver for the setup.cfg - cat > .gitattributes << EOF - setup.cfg merge=git-prefer-theirs-name-url - EOF - - - name: Rebase localstack branch with latest master from upstream - run: | - git fetch upstream - git rebase -f upstream/master - git log --oneline --graph --abbrev-commit --max-count 20 - - - name: Push - if: ${{ github.event.inputs.dry_run != 'true' }} - run: | - git push --force-with-lease - git push --atomic origin localstack - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index cef9cd16acff..000000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,125 +0,0 @@ -name: Release - -on: - workflow_dispatch: - inputs: - version: - description: 'Version' - required: true - current_release: - description: 'Release Docker and update version info in moto/__init__.py' - default: true - required: true - type: boolean - -jobs: - release-moto-job: - runs-on: ubuntu-latest - name: Release Moto - permissions: - contents: write - id-token: write - packages: write - env: - VERSION: 0.0.0 - steps: - - name: Set Env - run: | - echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - name: Set up Python 3.12 - uses: actions/setup-python@v6 - with: - python-version: 3.12 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install wheel setuptools packaging twine build --upgrade - pip install -r requirements-dev.txt - - 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 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 - docker stop moto - - name: Commit Version Change - run: | - git config --local user.email "admin@getmoto.org" - git config --local user.name "Moto Admin" - git add moto/__init__.py - git add setup.cfg - git commit -m "Pre-Release: Up Version Number" || echo "No Changes!" - git push || echo "No Changes!" - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - - name: Tag version on Github - run: | - git tag ${{ env.VERSION }} - git push origin ${{ env.VERSION }} - - name: Create GitHub release - uses: softprops/action-gh-release@v2 - with: - name: ${{ env.VERSION }} - tag_name: ${{ env.VERSION }} - files: dist/* - # 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@v6 - with: - platforms: linux/amd64,linux/arm64 - push: true - tags: | - motoserver/moto:latest - motoserver/moto:${{ env.VERSION }} - ghcr.io/getmoto/motoserver:latest - 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 - git config --local user.email "admin@getmoto.org" - git config --local user.name "Moto Admin" - git add moto/__init__.py - git add setup.cfg - git add CHANGELOG.md - git commit -m "Admin: Post-release steps" - git push diff --git a/.github/workflows/release_dev.yml b/.github/workflows/release_dev.yml deleted file mode 100644 index 929a2255e501..000000000000 --- a/.github/workflows/release_dev.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Release Dev - -on: [workflow_dispatch] - -jobs: - - release: - name: Dev Release - runs-on: ubuntu-latest - permissions: - id-token: write - packages: write - pull-requests: write - if: ${{ github.repository == 'getmoto/moto' }} - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - - name: Update & Build - run: | - pip install build - python update_version_from_git.py - python -m build - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - - name: Build Docker release - run: | - docker build -t motoserver/moto . --tag moto:latest - # Required to get the correct Digest - # See https://github.com/docker/build-push-action/issues/461 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Login to GHCR - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Push to DockerHub and GHCR - uses: docker/build-push-action@v6 - with: - push: true - platforms: linux/amd64,linux/arm64 - tags: | - motoserver/moto:latest - ghcr.io/getmoto/motoserver:latest