create-lt-adventure 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/addons/github-workflow/setup.mjs +0 -84
- package/package.json +1 -1
- package/templates/vite/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,23 +12,6 @@ import { fileURLToPath } from "url";
|
|
|
12
12
|
|
|
13
13
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
14
14
|
|
|
15
|
-
const data = await p.group(
|
|
16
|
-
{
|
|
17
|
-
features: () =>
|
|
18
|
-
p.multiselect({
|
|
19
|
-
message: "Additional features?",
|
|
20
|
-
initialValues: ["ftp", "discord"],
|
|
21
|
-
required: false,
|
|
22
|
-
options: [
|
|
23
|
-
// { label: "Prereleases", value: "prereleases" },
|
|
24
|
-
{ label: "Uploading via FTP", value: "ftp" },
|
|
25
|
-
{ label: "Discord webhook on updates", value: "discord" },
|
|
26
|
-
],
|
|
27
|
-
}),
|
|
28
|
-
},
|
|
29
|
-
{ onCancel: () => process.exit(0) },
|
|
30
|
-
);
|
|
31
|
-
|
|
32
15
|
// Grab main.yml template
|
|
33
16
|
const mainYmlTemplate = await readFile(`${__dirname}/main.yml`, "utf8");
|
|
34
17
|
|
|
@@ -37,67 +20,6 @@ const moduleDir = process.env.MODULE_DIR || process.cwd();
|
|
|
37
20
|
|
|
38
21
|
let mainYml = mainYmlTemplate;
|
|
39
22
|
|
|
40
|
-
// I should probably just make this a JSON and convert it to accursed YAML at the end step...
|
|
41
|
-
if (data.features.includes("discord") || data.features.includes("ftp")) {
|
|
42
|
-
mainYml += `
|
|
43
|
-
# https://stackoverflow.com/questions/61919141/read-json-file-in-github-actions
|
|
44
|
-
- id: set_var
|
|
45
|
-
run: echo "PACKAGE_JSON=$(jq -c . < module.json)" >> $GITHUB_OUTPUT
|
|
46
|
-
|
|
47
|
-
- name: Get FTP Path
|
|
48
|
-
id: ftp
|
|
49
|
-
run: echo "ftp=\${{fromJson(steps.set_var.outputs.PACKAGE_JSON).flags.ftpPath}}" >> $GITHUB_OUTPUT
|
|
50
|
-
|
|
51
|
-
- name: Get Module ID
|
|
52
|
-
id: module_id
|
|
53
|
-
run: echo "module_id=\${{fromJson(steps.set_var.outputs.PACKAGE_JSON).id}}" >> $GITHUB_OUTPUT
|
|
54
|
-
|
|
55
|
-
- name: Get Module Title
|
|
56
|
-
id: title
|
|
57
|
-
run: echo "title=\${{fromJson(steps.set_var.outputs.PACKAGE_JSON).title}}" >> $GITHUB_OUTPUT
|
|
58
|
-
`;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (data.features.includes("ftp")) {
|
|
62
|
-
mainYml += `
|
|
63
|
-
- name: Put Files into FTP Folder
|
|
64
|
-
env:
|
|
65
|
-
FTP_PASSWORD: \${{ secrets.FTP_PASSWORD }}
|
|
66
|
-
if: \${{ env.FTP_PASSWORD != '' }}
|
|
67
|
-
run: |
|
|
68
|
-
ls
|
|
69
|
-
mkdir _ftp
|
|
70
|
-
cp module.json _ftp/
|
|
71
|
-
cp module.zip _ftp/
|
|
72
|
-
mkdir _ftp/\${{steps.module_id.outputs.module_id}}
|
|
73
|
-
cp module.json _ftp/\${{steps.module_id.outputs.module_id}}/
|
|
74
|
-
|
|
75
|
-
- name: Upload FTP
|
|
76
|
-
uses: sebastianpopp/ftp-action@releases/v2
|
|
77
|
-
env:
|
|
78
|
-
FTP_PASSWORD: \${{ secrets.FTP_PASSWORD }}
|
|
79
|
-
if: \${{ env.FTP_PASSWORD != '' }}
|
|
80
|
-
with:
|
|
81
|
-
host: \${{ secrets.FTP_SERVER }}
|
|
82
|
-
user: \${{ secrets.FTP_USERNAME }}
|
|
83
|
-
password: \${{ env.FTP_PASSWORD }}
|
|
84
|
-
localDir: _ftp
|
|
85
|
-
remoteDir: \${{steps.ftp.outputs.ftp}}
|
|
86
|
-
`;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (data.features.includes("discord")) {
|
|
90
|
-
mainYml += `
|
|
91
|
-
- name: Send Discord Ping
|
|
92
|
-
uses: Ilshidur/action-discord@0.3.2
|
|
93
|
-
env:
|
|
94
|
-
DISCORD_WEBHOOK: \${{ secrets.DISCORD_WEBHOOK }}
|
|
95
|
-
if: \${{ env.DISCORD_WEBHOOK != '' && !github.event.release.prerelease }}
|
|
96
|
-
with:
|
|
97
|
-
args: "\${{steps.title.outputs.title}} has been updated to version \`\${{github.event.release.tag_name}}\`!"
|
|
98
|
-
`;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
23
|
// Create main.yml file
|
|
102
24
|
const workflowDir = `${moduleDir}/.github/workflows`;
|
|
103
25
|
await mkdir(workflowDir, { recursive: true });
|
|
@@ -106,10 +28,4 @@ await writeFile(`${workflowDir}/main.yml`, mainYml);
|
|
|
106
28
|
let note = "✅ Installed!";
|
|
107
29
|
note += "\nThe Github workflow is triggered by making a new release. To make a new release go to your repository's Releases page which can be found in the sidebar on the right and press \"Draft a new release.\" Fill in the version number and you're done!"
|
|
108
30
|
|
|
109
|
-
if (data.features.includes("discord"))
|
|
110
|
-
note +=
|
|
111
|
-
"\n - For the Discord integration, make sure to create a DISCORD_WEBHOOK secret with the webhook url.";
|
|
112
|
-
if (data.features.includes("ftp"))
|
|
113
|
-
note += `\n - For the FTP integration, make sure to include the FTP_SERVER, FTP_USERNAME, and FTP_PASSWORD secrets.\n\tThe module JSON also can include a flag stating its subdirectory on the FTP server under ${cyan("flags.ftpPath")}.`;
|
|
114
|
-
|
|
115
31
|
p.note(note, "Github Workflow");
|
package/package.json
CHANGED