]> git.lizzy.rs Git - cheatdb.git/blob - app/flatpages/help/release_webhooks.md
Add links to GitHub oauth connection settings
[cheatdb.git] / app / flatpages / help / release_webhooks.md
1 title: Creating Releases using Webhooks
2
3 ## What does this mean?
4
5 A webhook is a notification from one service to another. Put simply, a webhook
6 is used to notify ContentDB that the git repository has changed.
7
8 ContentDB offers the ability to automatically create releases using webhooks
9 from either Github or Gitlab. If you're not using either of those services,
10 you can also use the [API](../api) to create releases.
11
12 The process is as follows:
13
14 1. The user creates an API Token and a webhook to use it. This can be done automatically
15    for Github.
16 2. The user pushes a commit to the git host (Gitlab or Github).
17 3. The git host posts a webhook notification to ContentDB, using the API token assigned to it.
18 4. ContentDB checks the API token and issues a new release.
19
20 <p class="alert alert-info">
21         This feature is in beta, and is only available for Trusted Members.
22 </p>
23
24 ## Setting up
25
26 ### GitHub (automatic)
27
28 1. Go to your package's page.
29 2. Make sure that the repository URL is set to a Github repository.
30    Only github.com is supported.
31 3. Go to "Releases" > "+", and click "Setup webhook" at the top of the create release
32    page.
33    If you do not see this, either the repository isn't using Github or you do
34    not have permission to use webhook releases (ie: you're not a Trusted Member).
35 4. Grant ContentDB the ability to manage Webhooks.
36 5. Set the event to either "New tag or Github Release" (highly recommended) or "Push".
37
38    N.B.: GitHub uses tags to power GitHub Releases, meaning that creating a webhook
39    on "New tag" will sync GitHub and ContentDB releases.
40
41 ### GitHub (manual)
42
43 1. Create an API Token by visiting your profile and clicking "API Tokens: Manage".
44 2. Copy the access token that was generated.
45 3. Go to the repository's settings > Webhooks > Add Webhook.
46 4. Set the payload URL to `https://content.minetest.net/github/webhook/`
47 5. Set the content type to JSON.
48 6. Set the secret to the access token that you copied.
49 7. Set the events
50   * If you want a rolling release, choose "just the push event".
51   * Or if you want a stable release cycle based on tags,
52     choose "Let me select" > Branch or tag creation.
53
54 ### GitLab (manual)
55
56 1. Create an API Token by visiting your profile and clicking "API Tokens: Manage".
57 2. Copy the access token that was generated.
58 3. Go to the repository's settings > Integrations.
59 4. Set the URL to `https://content.minetest.net/gitlab/webhook/`
60 6. Set the secret token to the access token that you copied.
61 7. Set the events
62     * If you want a rolling release, choose "Push events".
63     * Or if you want a stable release cycle based on tags,
64       choose "Tag push events".
65
66 ## Configuring
67
68 ### Setting minimum and maximum Minetest versions
69
70 <p class="alert alert-info">
71         This feature is unimplemented.
72 </p>
73
74 1. Open up the conf file for the package.
75    This will be `game.conf`, `mod.conf`, `modpack.conf`, or `texture_pack.conf`
76    depending on the content type.
77 2. Set `min_protocol` and `max_protocol` to the respective protocol numbers
78    of the Minetest versions.
79      * 0.4 = 32
80      * 5.0 = 37
81      * 5.1 = 38