diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml new file mode 100644 index 0000000..11376a3 --- /dev/null +++ b/.forgejo/workflows/release.yml @@ -0,0 +1,25 @@ +name: Release + +on: + workflow_dispatch: + +jobs: + release: + name: Release + runs-on: docker + container: + image: ghcr.io/catthehacker/ubuntu:act-22.04 + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Install Rokit + uses: https://github.com/CompeyDev/setup-rokit@v0.1.2 + with: + token: ${{ secrets.githubtoken }} + + - name: Authorize + run: pesde auth login --token "${{ secrets.pesde_auth_token }}" + + - name: Publish + run: pesde publish -y diff --git a/.forgejo/workflows/syncandrelease.yml b/.forgejo/workflows/sync.yml similarity index 52% rename from .forgejo/workflows/syncandrelease.yml rename to .forgejo/workflows/sync.yml index 945b23a..e5a95d1 100644 --- a/.forgejo/workflows/syncandrelease.yml +++ b/.forgejo/workflows/sync.yml @@ -10,7 +10,7 @@ jobs: name: Sync runs-on: docker container: - image: ghcr.io/catthehacker/ubuntu:act-24.04 + image: ghcr.io/catthehacker/ubuntu:act-22.04 steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -20,35 +20,9 @@ jobs: with: token: ${{ secrets.githubtoken }} - - name: Install forgejo-cli - run: | - wget https://codeberg.org/Cyborus/forgejo-cli/releases/download/v0.2.0/forgejo-cli-linux.gz -O fj.gz - gunzip fj.gz - mv fj /usr/local/bin/fj - chmod +x /usr/local/bin/fj - - name: Pull Newest Jecs run: lune run pull.luau ${{ secrets.githubtoken }} - - name: Authorize - run: pesde auth login --token "${{ secrets.pesde_auth_token }}" - - - name: Publish Luau Target - run: pesde publish -y - - - name: Manifest Switcharoo - run: | - mv pesde.toml pesde-luau.toml - mv pesde-rbx.toml pesde.toml - - - name: Publish Roblox Target - run: pesde publish -y - - - name: Manifest Switcharoo - run: | - mv pesde.toml pesde-rbx.toml - mv pesde-luau.toml pesde.toml - - name: Read Jecs Version id: read_jecs_version run: | @@ -66,11 +40,3 @@ jobs: commit-message: Sync to upstream Jecs ${{ steps.read_jecs_version.outputs.JECS_VERSION }} base: main token: ${{ secrets.privileged_forgejo_token }} - - - name: Merge Pull Request - shell: bash - run: | - if [ ! -z "${{ steps.create_pull_request.outputs.pull-request-number }}" ]; then - fj --host git.devmarked.win auth add-key marked ${{ secrets.privileged_forgejo_token }} - fj --host git.devmarked.win pr merge --method squash "${{ steps.create_pull_request.outputs.pull-request-number }}" - fi diff --git a/.lune/pull.luau b/.lune/pull.luau index 08b9b55..15cb1ce 100644 --- a/.lune/pull.luau +++ b/.lune/pull.luau @@ -4,10 +4,94 @@ local net = require("@lune/net") local process = require("@lune/process") local serde = require("@lune/serde") -local types = require("./types") - print("-- 🟧 Starting pull of latest release...") +type wally_manifest = { + package: { + name: string, + version: string, + registry: string, + realm: string, + license: string?, + exclude: { string }?, + include: { string }?, + }, + dependencies: { + [string]: string, + }, +} + +type environment = "luau" | "lune" | "roblox" | "roblox_server" +type pesde_dependency = { + name: string, + version: string, + index: string?, + target: environment?, +} | { + wally: string, + version: string, + index: string?, +} | { + repo: string, + rev: string, + path: string?, +} + +type pesde_manifest = { + name: string, + version: string, + description: string?, + license: string?, + authors: { string }?, + repository: string?, + private: boolean?, + includes: { string }?, + pesde_version: string?, + workspace_members: { string }?, + + target: { + environment: environment, + lib: string, + bin: string?, + build_files: { string }?, + }, + + scripts: { + roblox_sync_config_generator: string?, + sourcemap_generator: string?, + + [string]: string, + }?, + + indices: { + default: string, + + [string]: string, + }, + wally_indices: { + default: string, + + [string]: string, + }?, + + overrides: { + [string]: pesde_dependency, + }?, + patches: { + [string]: { [string]: string }, + }?, + + dependencies: { + [string]: pesde_dependency, + }?, + peer_dependencies: { + [string]: pesde_dependency, + }?, + dev_dependencies: { + [string]: pesde_dependency, + }?, +} + print("🟧 Fetching github token...") local github_token: string = process.args[1] @@ -30,7 +114,7 @@ if not pull_manifest_res.ok then error(`❌ Couldn't download jecs manifest: {pull_manifest_res.statusCode} {pull_manifest_res.statusMessage}`) end local manifest_contents = pull_manifest_res.body -local manifest: types.wally_manifest = serde.decode("toml", manifest_contents) or error("Couldn't decode manifest.") +local manifest: wally_manifest = serde.decode("toml", manifest_contents) or error("Couldn't decode manifest.") local jecs_version = manifest.package.version print(`✅ Got latest manifest. Version: {jecs_version}`) @@ -105,7 +189,7 @@ Install with pesde @ `marked/jecs` fs.writeFile("README.md", new_readme_contents) print(`✅ Modified README.md.`) -local pesde_manifest: types.pesde_manifest = { +local pesde_manifest: pesde_manifest = { name = "marked/jecs", description = "A minimal copy of jecs published on the official pesde registry", version = jecs_version, @@ -131,38 +215,9 @@ local pesde_manifest: types.pesde_manifest = { }, } -local pesde_roblox_manifest: types.pesde_manifest = { - name = "marked/jecs", - description = "A minimal copy of jecs published on the official pesde registry", - version = jecs_version, - authors = { "jecs authors" }, - repository = "https://git.devmarked.win/marked/jecs-pesde", - license = manifest.package.license, - includes = { - "init.luau", - "pesde.toml", - "README.md", - "CHANGELOG.md", - "LICENSE", - ".luaurc", - }, - - target = { - environment = "roblox", - lib = "init.luau", - build_files = { "init.luau" }, - }, - - indices = { - default = "https://github.com/pesde-pkg/index", - }, -} - print("🟧 Writing pesde manifest...") local serialized_manifest = serde.encode("toml", pesde_manifest, true) fs.writeFile("pesde.toml", serialized_manifest) -local serialized_rbx_manifest = serde.encode("toml", pesde_roblox_manifest, true) -fs.writeFile("pesde-rbx.toml", serialized_rbx_manifest) print("✅ Wrote pesde manifest.") print("-- ✅ Finished pulling latest release.") diff --git a/.lune/read_version.luau b/.lune/read_version.luau index a89345d..ee4ef9a 100644 --- a/.lune/read_version.luau +++ b/.lune/read_version.luau @@ -2,10 +2,79 @@ local fs = require("@lune/fs") local serde = require("@lune/serde") -local types = require("./types") +type environment = "luau" | "lune" | "roblox" | "roblox_server" +type pesde_dependency = { + name: string, + version: string, + index: string?, + target: environment?, +} | { + wally: string, + version: string, + index: string?, +} | { + repo: string, + rev: string, + path: string?, +} + +type pesde_manifest = { + name: string, + version: string, + description: string?, + license: string?, + authors: { string }?, + repository: string?, + private: boolean?, + includes: { string }?, + pesde_version: string?, + workspace_members: { string }?, + + target: { + environment: environment, + lib: string, + bin: string?, + build_files: { string }?, + }, + + scripts: { + roblox_sync_config_generator: string?, + sourcemap_generator: string?, + + [string]: string, + }?, + + indices: { + default: string, + + [string]: string, + }, + wally_indices: { + default: string, + + [string]: string, + }?, + + overrides: { + [string]: pesde_dependency, + }?, + patches: { + [string]: { [string]: string }, + }?, + + dependencies: { + [string]: pesde_dependency, + }?, + peer_dependencies: { + [string]: pesde_dependency, + }?, + dev_dependencies: { + [string]: pesde_dependency, + }?, +} local manifest_contents = fs.readFile("pesde.toml") -local manifest: types.pesde_manifest = serde.decode("toml", manifest_contents) or error("Couldn't decode manifest.") +local manifest: pesde_manifest = serde.decode("toml", manifest_contents) or error("Couldn't decode manifest.") local jecs_version = manifest.version print(jecs_version) diff --git a/.lune/types.luau b/.lune/types.luau deleted file mode 100644 index 379d3f9..0000000 --- a/.lune/types.luau +++ /dev/null @@ -1,88 +0,0 @@ ---!strict -export type wally_manifest = { - package: { - name: string, - version: string, - registry: string, - realm: string, - license: string?, - exclude: { string }?, - include: { string }?, - }, - dependencies: { - [string]: string, - }, -} - -export type environment = "luau" | "lune" | "roblox" | "roblox_server" -export type pesde_dependency = { - name: string, - version: string, - index: string?, - target: environment?, -} | { - wally: string, - version: string, - index: string?, -} | { - repo: string, - rev: string, - path: string?, -} - -export type pesde_manifest = { - name: string, - version: string, - description: string?, - license: string?, - authors: { string }?, - repository: string?, - private: boolean?, - includes: { string }?, - pesde_version: string?, - workspace_members: { string }?, - - target: { - environment: environment, - lib: string, - bin: string?, - build_files: { string }?, - }, - - scripts: { - roblox_sync_config_generator: string?, - sourcemap_generator: string?, - - [string]: string, - }?, - - indices: { - default: string, - - [string]: string, - }, - wally_indices: { - default: string, - - [string]: string, - }?, - - overrides: { - [string]: pesde_dependency, - }?, - patches: { - [string]: { [string]: string }, - }?, - - dependencies: { - [string]: pesde_dependency, - }?, - peer_dependencies: { - [string]: pesde_dependency, - }?, - dev_dependencies: { - [string]: pesde_dependency, - }?, -} - -return {} diff --git a/pesde-rbx.toml b/pesde-rbx.toml deleted file mode 100644 index c465287..0000000 --- a/pesde-rbx.toml +++ /dev/null @@ -1,22 +0,0 @@ -authors = ["jecs authors"] -description = "A minimal copy of jecs published on the official pesde registry" -includes = [ - "init.luau", - "pesde.toml", - "README.md", - "CHANGELOG.md", - "LICENSE", - ".luaurc", -] -license = "MIT" -name = "marked/jecs" -repository = "https://git.devmarked.win/marked/jecs-pesde" -version = "0.5.5" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = ["init.luau"] -environment = "roblox" -lib = "init.luau" diff --git a/pesde.lock b/pesde.lock new file mode 100644 index 0000000..f84e716 --- /dev/null +++ b/pesde.lock @@ -0,0 +1,3 @@ +name = "marked/jecs" +version = "0.5.3" +target = "luau" diff --git a/rokit.toml b/rokit.toml index f864c9f..91e0ac9 100644 --- a/rokit.toml +++ b/rokit.toml @@ -5,5 +5,4 @@ [tools] lune = "lune-org/lune@0.8.9" -pesde = "daimond113/pesde@0.6.1+registry.0.2.2" -luau-lsp = "johnnymorganz/luau-lsp@1.37.0" # https://discord.com/channels/385151591524597761/1259775232533856327/1326154624335347732 +pesde = "daimond113/pesde@0.6.0+registry.0.2.0"