Simplify the version bump process. ### Description

Simplify the version bump process.

- Use substitution hook in docs to update CDN URL.
  - In `dev` or `prerelease` versions, it will point to `dev` url
  - In `stable` versions, it will point it `vX.Y.Z` url
- Introduce a version bump script `tools/bump_version.py`.


~- Use `bump2version` to bump Python versions (continuing from #2460)~
~- Use `npm version` to bump JS versions~
~- Update `run_docker` script to use latest deployed pre-built docker image when `--pre-built` option is specified.~

### Checklists

- [x] Add new / update outdated documentation

(downloading_deploying)=

# Downloading and deploying Pyodide

## Downloading Pyodide

### CDN

Pyodide packages, including the `pyodide.js` file, are available from the JsDelivr CDN,

| channel             | indexURL                                         | Comments                                                                                 | REPL                                               |
| ------------------- | ------------------------------------------------ | ---------------------------------------------------------------------------------------- | -------------------------------------------------- |
| Latest release      | `https://cdn.jsdelivr.net/pyodide/v0.20.0/full/` | Recommended, cached by the browser                                                       | [link](https://pyodide.org/en/stable/console.html) |
| Dev (`main` branch) | `https://cdn.jsdelivr.net/pyodide/dev/full/`     | Re-deployed for each commit on main, no browser caching, should only be used for testing | [link](https://pyodide.org/en/latest/console.html) |

To access a particular file, append the file name to `indexURL`. For instance,
`"${indexURL}pyodide.js"` in the case of `pyodide.js`.

```{warning}
The previous CDN `pyodide-cdn2.iodide.io` is deprecated and should not be used.
```

### GitHub releases

You can also download Pyodide packages from [GitHub
releases](https://github.com/pyodide/pyodide/releases)
(`pyodide-build-*.tar.bz2` file) serve them yourself, as explained in the
following section.

(serving_pyodide_packages)=

## Serving Pyodide packages

If you built your Pyodide distribution or downloaded the release tarball
you need to serve Pyodide files with appropriate headers.

### Serving locally

With Python 3.7.5+ you can serve Pyodide files locally by starting

```
python -m http.server
```

from the Pyodide distribution folder.

Point your WebAssembly aware browser to
[http://localhost:8000/console.html](http://localhost:8000/console.html) and open
your browser console to see the output from Python via Pyodide!

### Remote deployments

Any solution that is able to host static files and correctly sets WASM
MIME type, and CORS headers would work. For instance, you can use GitHub Pages
or similar services.

For additional suggestions for optimizing size and load times, see the [Emscripten
documentation about deployments](https://emscripten.org/docs/compiling/Deploying-Pages.html).

(downloading_deploying)=

# Downloading and deploying Pyodide

## Downloading Pyodide

### CDN

Pyodide packages, including the `pyodide.js` file, are available from the JsDelivr CDN,

| channel             | indexURL                                     | Comments                                                                                 | REPL                                               |
| ------------------- | -------------------------------------------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------- |
| Latest release      | `{{PYODIDE_CDN_URL}}`                        | Recommended, cached by the browser                                                       | [link](https://pyodide.org/en/stable/console.html) |
| Dev (`main` branch) | `https://cdn.jsdelivr.net/pyodide/dev/full/` | Re-deployed for each commit on main, no browser caching, should only be used for testing | [link](https://pyodide.org/en/latest/console.html) |

To access a particular file, append the file name to `indexURL`. For instance,
`"${indexURL}pyodide.js"` in the case of `pyodide.js`.

```{warning}
The previous CDN `pyodide-cdn2.iodide.io` is deprecated and should not be used.
```

### GitHub releases

You can also download Pyodide packages from [GitHub
releases](https://github.com/pyodide/pyodide/releases)
(`pyodide-build-*.tar.bz2` file) serve them yourself, as explained in the
following section.

(serving_pyodide_packages)=

## Serving Pyodide packages

If you built your Pyodide distribution or downloaded the release tarball
you need to serve Pyodide files with appropriate headers.

### Serving locally

With Python 3.7.5+ you can serve Pyodide files locally by starting

```
python -m http.server
```

from the Pyodide distribution folder.

Point your WebAssembly aware browser to
[http://localhost:8000/console.html](http://localhost:8000/console.html) and open
your browser console to see the output from Python via Pyodide!

### Remote deployments

Any solution that is able to host static files and correctly sets WASM
MIME type, and CORS headers would work. For instance, you can use GitHub Pages
or similar services.

For additional suggestions for optimizing size and load times, see the [Emscripten
documentation about deployments](https://emscripten.org/docs/compiling/Deploying-Pages.html).
