https://github.com/cdce8p/mypy-wheels
https://github.com/cdce8p/mypy-wheels
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/cdce8p/mypy-wheels
- Owner: cdce8p
- Created: 2023-02-22T23:19:51.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2026-04-02T19:31:55.000Z (2 months ago)
- Last Synced: 2026-04-03T06:23:48.785Z (2 months ago)
- Language: HCL
- Homepage:
- Size: 241 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Mypy wheels
Repo to build custom mypy mypyc wheels.
Only used for personal tests.
Official mypy test wheels can be found at: https://github.com/mypyc/mypy_mypyc-wheels/
## How does it work?
* Each push to the [`cdce8p/mypy`](https://github.com/cdce8p/mypy) triggers a webhook.
* The `POST` request is send to an AWS API Gateway which calls a Lambda function.
* That in turn validates the data and sends another `POST` request to Github Actions
to trigger a [`repository_dispatch`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#repository_dispatch) event.
* The workflow first checks if the wheels already exist as release in [mypyc/mypy_mypyc-wheels](https://github.com/mypyc/mypy_mypyc-wheels/) or this repo. If not, it creates a new tag which contains a new file called `mypy_commit`.
* This then triggers the `Build wheels` workflow.
## Setup
```bash
# Aliases
alias ta="terraform apply"
alias td="terraform destroy"
# Create Secret for data signature
ruby -rsecurerandom -e 'puts SecureRandom.hex(20)'
```
**Github PAT**
Create (fine-grained) PAT token with `metadata:read` and `contents:read&write` permissions for the repo.
Add token as `PUSH_TOKEN` to Github Action secrets.
**Create `secrets.auto.tfvars`**
```HCL
github_pat =
sig_key =
mail_source =
mail_recipient =
```
**Setup webhook**
* Add new webhook
* `Payload URL`: `/webhook`
* `Content type`: `application/json`
* `Secret`: ``
* Trigger on `push` event
**Setup AWS Lambda function**
* Build lambda dependencies: run task `Pip build Lambda deps`.
* Create cloud infrastructure with Terraform: `ta`
### Refs
https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#push
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#repository_dispatch
https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-dispatch-event
https://docs.github.com/en/webhooks-and-events/webhooks/securing-your-webhooks
https://mainawycliffe.dev/blog/github-actions-trigger-via-webhooks/