From 49eb60073bda97a731c748d4c9cfb5a468b4a0a0 Mon Sep 17 00:00:00 2001 From: AHQ Miness Date: Sun, 1 Sep 2024 20:06:11 +0530 Subject: [PATCH] mjs --- .github/workflows/publish.yml | 2 +- index.cjs => index.mjs | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) rename index.cjs => index.mjs (76%) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4745f52..7859e52 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -36,7 +36,7 @@ jobs: with: result-encoding: string script: | - const version = await require("./index.cjs")(); + const version = await require("./index.mjs")(); console.log(`Version: ${version}`); return version; diff --git a/index.cjs b/index.mjs similarity index 76% rename from index.cjs rename to index.mjs index 305a149..0aff66c 100644 --- a/index.cjs +++ b/index.mjs @@ -1,6 +1,6 @@ -module.exports = async function () { - const { Octokit } = require("octokit"); +import { Octokit } from "octokit"; +export default async function () { const { version } = require("./tauri/package.json"); const client = new Octokit({ @@ -16,11 +16,9 @@ module.exports = async function () { }); return release.data.id; -}; - -module.exports.release = async function () { - const { Octokit } = require("octokit"); +} +export async function release() { const client = new Octokit({ auth: process.env.token, }); @@ -31,4 +29,4 @@ module.exports.release = async function () { release_id: process.env.release_id, draft: false, }); -}; +}