mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-23 02:55:46 +01:00
e40fc6ef84
Introduces a new workflow that runs when a new build has been published on GitHub Releases. It converts the release notes to Hangar Markdown and sends it to Hangar along with the jar-file. Note: The workflow currently relies on the version string being appended to the filename of the jar-file. Without it, the file reference in the `curl` request that uploads the build would need to change. The workflow references a new secret, `HANGAR_TOKEN`, which is just an API key for the Hangar API. The token was created in the Hangar profile settings (API Keys), and its only permission is `create_version`. In order to properly upload a new build to Hangar, we need to construct a somewhat complex JSON object. This is because the Hangar API allows for publishing releases on multiple platforms and for multiple versions, which makes the simple use case for MobArena's single file upload look a bit overcomplicated. Unlike the CurseForge API, the Hangar API supports "normal" platform version strings, so we don't need to map anything. It also supports patch version wildcards, so we can get away with `1.18.x`, `1.19.x`, etc. for each version supported. The API only uses the API key for authentication, which means we need to grab a JWT and use that for the actual upload request. Note that the `pluginDependencies` property is currently required, but it can be left empty. The workflow can be invoked directly via the `workflow_dispatch` event, which might come in handy if something in the pipeline breaks. The Hangar base URL and project slug are both hardcoded, and things would probably be cleaner if they were made into variables, but we don't need this workflow anywhere else, so it's fine for now. |
||
---|---|---|
.. | ||
ISSUE_TEMPLATE | ||
workflows | ||
CONTRIBUTING.md | ||
PULL_REQUEST_TEMPLATE.md |