2.2 KiB
title: Creating Releases using Webhooks
What does this mean?
A webhook is a notification from one service to another. Put simply, a webhook is used to notify ContentDB that the git repository has changed.
ContentDB offers the ability to automatically create releases using webhooks from either Github or Gitlab. If you're not using either of those services, you can also use the API to create releases.
ContentDB also offers the ability to poll a Git repo and check for updates without any web hooks, this is limited to once a day. See Automatic Update Detection.
The process is as follows:
- The user creates an API Token and a webhook to use it.
- The user pushes a commit to the git host (Gitlab or Github).
- The git host posts a webhook notification to ContentDB, using the API token assigned to it.
- ContentDB checks the API token and issues a new release.
Setting up
GitHub
- Create a ContentDB API Token at Profile > API Tokens: Manage.
- Copy the access token that was generated.
- Go to the GitLab repository's settings > Webhooks > Add Webhook.
- Set the payload URL to
https://content.minetest.net/github/webhook/
- Set the content type to JSON.
- Set the secret to the access token that you copied.
- Set the events
- If you want a rolling release, choose "just the push event".
- Or if you want a stable release cycle based on tags, choose "Let me select" > Branch or tag creation.
- Create.
GitLab
- Create a ContentDB API Token at Profile > API Tokens: Manage.
- Copy the access token that was generated.
- Go to the GitLab repository's settings > Webhooks.
- Set the URL to
https://content.minetest.net/gitlab/webhook/
- Set the secret token to the ContentDB access token that you copied.
- Set the events
- If you want a rolling release, choose "Push events".
- Or if you want a stable release cycle based on tags, choose "Tag push events".
- Add webhook.
Configuring
See the Package Configuration and Releases Guide for documentation on configuring the release creation. You can set the min/max Minetest version from the Git repository, and also configure what files are included.