Skip to content

Commit 7fe46ca

Browse files
author
Tom Grobbe
committed
chore(menuapi): Update docs and release pipeline
1 parent 8b52645 commit 7fe46ca

6 files changed

Lines changed: 81 additions & 22 deletions

File tree

.github/workflows/build.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ on:
66
- '**'
77
pull_request:
88

9+
# Least privilege by default. The release job elevates its own permissions
10+
# (contents: write for tags/releases, id-token: write for NuGet OIDC).
911
permissions:
10-
contents: write
12+
contents: read
1113

1214
# Cancel any in-progress run on the same branch
1315
concurrency:
@@ -130,6 +132,12 @@ jobs:
130132
if: github.ref == 'refs/heads/fivem-enhanced'
131133
runs-on: windows-latest
132134

135+
# contents: write for the git tag + GitHub release; id-token: write so NuGet
136+
# Trusted Publishing (OIDC) can mint a short-lived key (no API-key secret).
137+
permissions:
138+
contents: write
139+
id-token: write
140+
133141
outputs:
134142
release_url: ${{ steps.create_release.outputs.release_url }}
135143

@@ -201,11 +209,20 @@ jobs:
201209
202210
echo "release_url=$RELEASE_URL" >> "$GITHUB_OUTPUT"
203211
204-
- name: Publish NuGet — FiveM
212+
# NuGet Trusted Publishing (OIDC): exchange the GitHub Actions id-token for a
213+
# short-lived NuGet API key. No long-lived NUGET_API_KEY secret is needed.
214+
# Requires a matching trusted-publishing policy on nuget.org (see below).
215+
- name: NuGet login (trusted publishing)
216+
uses: NuGet/login@v1
217+
id: nuget_login
218+
with:
219+
user: ${{ vars.NUGET_USER }}
220+
221+
- name: Publish NuGet (FiveM Enhanced)
205222
run: >-
206223
dotnet nuget push
207224
"release-assets/MenuAPI.FiveM.Enhanced.${{ needs.version.outputs.semver }}.nupkg"
208-
--api-key ${{ secrets.NUGET_API_KEY }}
225+
--api-key ${{ steps.nuget_login.outputs.NUGET_API_KEY }}
209226
--source https://api.nuget.org/v3/index.json
210227
--skip-duplicate
211228

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Designed specifically as a replacement of **NativeUI**, MenuAPI features perform
88

99
This is the **FiveM Enhanced** version, targeting `net10.0` and the modern `CitizenFX.FiveM.Client` runtime.
1010

11+
> ⚠️ **Work in progress:** MenuAPI for FiveM Enhanced is an early alpha. The API and docs are still changing, and NuGet releases are published as pre-release (`0.0.1-alpha`).
12+
1113
This has been coded from the ground up. Using decompiled scripts from GTA V to figure out what some undocumented natives were used for.
1214

1315
## Installation

docs/enhanced/astro.config.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ export default defineConfig({
2424
// Point the header logo + title link at the MenuAPI chooser (see src/routeData.ts).
2525
routeMiddleware: './src/routeData.ts',
2626
// SocialIcons adds a "Back to all docs" pill into the header nav.
27-
components: { SocialIcons: './src/components/SocialIcons.astro' },
27+
// Banner is overridden to always show a site-wide work-in-progress notice.
28+
components: {
29+
SocialIcons: './src/components/SocialIcons.astro',
30+
Banner: './src/components/Banner.astro',
31+
},
2832
head: [
2933
{ tag: 'link', attrs: { rel: 'preconnect', href: 'https://fonts.googleapis.com' } },
3034
{ tag: 'link', attrs: { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: true } },
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
// Override of Starlight's default Banner. The default only renders a banner when
3+
// a page sets `banner` in its frontmatter; this one always renders a site-wide
4+
// "work in progress" notice, since MenuAPI for FiveM Enhanced is an early alpha.
5+
// Using the built-in `.sl-banner` class keeps Starlight's native banner styling.
6+
---
7+
8+
<div class="sl-banner">
9+
⚠️ <strong>Work in progress.</strong> MenuAPI for FiveM Enhanced is an early <strong>alpha</strong>.
10+
The library, its API, and these docs are still changing and may be incomplete or inaccurate.
11+
</div>

docs/enhanced/src/content/docs/index.md

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Welcome to the **MenuAPI** documentation.
88

99
Here you'll find basic information about how to use MenuAPI in your projects.
1010

11+
:::caution[Work in progress]
12+
**MenuAPI for FiveM Enhanced is an early alpha and a work in progress.** The library and these docs are still being built out, so expect breaking changes, missing pieces, and pages that may not yet match the latest code. The NuGet package is published as a pre-release (`0.0.1-alpha`).
13+
:::
14+
1115
:::tip
1216
**Please choose a category on the left to get started.**
1317
:::
@@ -27,55 +31,72 @@ Here you'll find basic information about how to use MenuAPI in your projects.
2731
Here are some examples of what you can expect to be able to achieve with this API (if you put some time into it). Most of these screenshots are taken from vMenu after it was converted to this MenuAPI. Some are taken from the example menu provided with MenuAPI.
2832

2933
<details>
30-
<summary>Makeup &amp; Hair color panels, and also opacity panels.</summary>
31-
They actually are just list items but you can toggle these panels to appear below the description box if you want them enabled
32-
![](https://www.vespura.com/hi/i/2018-12-15_19-35_84470_391.png)
33-
![](https://www.vespura.com/hi/i/2018-12-15_19-38_b6ca4_392.png)
34-
![](https://www.vespura.com/hi/i/2018-12-15_19-39_6abc3_393.png)
34+
<summary>Makeup &amp; Hair color panels, and also opacity panels.</summary>
35+
36+
They actually are just list items but you can toggle these panels to appear below the description box if you want them enabled
37+
38+
![](https://www.vespura.com/hi/i/2018-12-15_19-35_84470_391.png)
39+
![](https://www.vespura.com/hi/i/2018-12-15_19-38_b6ca4_392.png)
40+
![](https://www.vespura.com/hi/i/2018-12-15_19-39_6abc3_393.png)
41+
3542
</details>
3643

3744
<details>
38-
<summary>List items</summary>
39-
![](https://www.vespura.com/hi/i/2018-12-15_19-40_2e308_394.png)
45+
<summary>List items</summary>
46+
47+
![](https://www.vespura.com/hi/i/2018-12-15_19-40_2e308_394.png)
48+
4049
</details>
4150

4251
<details>
43-
<summary>Slider items</summary>
44-
You can have your own custom colors. Both background and foreground bar colors are fully customizable.
52+
<summary>Slider items</summary>
53+
54+
You can have your own custom colors. Both background and foreground bar colors are fully customizable.
4555

4656
![](https://www.vespura.com/hi/i/2018-12-15_19-46_420c5_397.png)
4757

4858
Optionally you can also choose from 29 different sprites to appear on either side of the slider.
59+
4960
</details>
5061

5162
<details>
52-
<summary>Checkbox items</summary>
53-
![](https://www.vespura.com/hi/i/2018-12-15_19-54_d2c94_398.png)
63+
<summary>Checkbox items</summary>
64+
65+
![](https://www.vespura.com/hi/i/2018-12-15_19-54_d2c94_398.png)
66+
5467
</details>
5568

5669
<details>
57-
<summary>Menus without banners</summary>
58-
You can create a menu without a banner if you prefer that.
59-
![](https://www.vespura.com/hi/i/2018-12-15_19-55_aea95_399.png)
70+
<summary>Menus without banners</summary>
71+
72+
You can create a menu without a banner if you prefer that.
73+
74+
![](https://www.vespura.com/hi/i/2018-12-15_19-55_aea95_399.png)
75+
6076
</details>
6177

6278

6379
<details>
64-
<summary>Customizable instructional buttons (per menu)</summary>
65-
Each menu can have it's own set of instructional buttons. By default every menu has one setup for 'select' and 'cancel/back'. But you can remove those if you don't need them.
80+
<summary>Customizable instructional buttons (per menu)</summary>
81+
82+
Each menu can have it's own set of instructional buttons. By default every menu has one setup for 'select' and 'cancel/back'. But you can remove those if you don't need them.
6683

6784
You can also disable the instructional buttons all together if you want to handle that yourself.
6885

6986
Instructional buttons instantly update if the user switches between keyboard/mouse and controller.
7087

7188
![](https://www.vespura.com/hi/i/2018-12-15_19-56_bc2c4_400.png)
89+
7290
</details>
7391

7492

7593
<details>
76-
<summary>Did somebody say icons?</summary>
77-
We've got plenty of those! (They don't even fit on one page, seriously there are 29 icons to choose from.)
94+
<summary>Did somebody say icons?</summary>
95+
96+
We've got plenty of those! (They don't even fit on one page, seriously there are 29 icons to choose from.)
7897

7998
You can also use icons even when you have text on the right side of an item, the text will move over for your icon automatically.
99+
80100
![](https://www.vespura.com/hi/i/2018-12-15_20-01_32cc2_401.png)
101+
81102
</details>

docs/enhanced/src/content/docs/setup.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ title: "Setup"
66

77
_Note, this is only for resource developers, don't install this on your server manually if you're not making a resource with it._
88

9+
:::caution[Pre-release]
10+
MenuAPI for FiveM Enhanced is a work in progress. Releases are published as a **pre-release** (`MenuAPI.FiveM.Enhanced`, currently `0.0.1-alpha`), so enable "include prerelease" in your NuGet client, and expect breaking changes while it stabilises.
11+
:::
12+
913
You have 2 options:
1014

1115
1. Download the latest release zip and include the DLL as a reference in your C# project, then add `using MenuAPI;` to each file where you need to use MenuAPI.

0 commit comments

Comments
 (0)