Skip to content

Commit

Permalink
chore: publish test
Browse files Browse the repository at this point in the history
  • Loading branch information
gjulivan committed Jan 15, 2025
1 parent 28440fe commit 4d8b1e5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/CreateGitHubRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
fi
- name: Install dependencies
run: pnpm install
- name: Create ${{ github.event.inputs.package }} widget release
run: pnpm run create-gh-release --filter=$PACKAGE
- name: Run publish script
run: pnpm run publish-marketplace --filter=$PACKAGE
env:
GH_USERNAME: ${{ secrets.GH_USERNAME }}
GH_EMAIL: ${{ secrets.GH_EMAIL }}
GH_NAME: ${{ secrets.GH_NAME }}
GH_PAT: ${{ secrets.GH_PAT }}
CPAPI_URL: ${{ secrets.CPAPI_URL }}
CPAPI_USER: ${{ secrets.CPAPI_USER }}
CPAPI_USER_OPENID: ${{ secrets.SRV_WIDGETS_OPENID }}
CPAPI_PASS: ${{ secrets.CPAPI_PASS }}
6 changes: 4 additions & 2 deletions automation/utils/bin/rui-publish-marketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { createDraft, publishDraft } from "../src/api/contributor";
async function main(): Promise<void> {
console.log(`Getting package information...`);
const { marketplace, version } = await getPublishedInfo(process.cwd());
const tag = process.env.TAG;
const tag = "rich-text-web-v4.2.0"; //process.env.TAG;

assert.ok(tag, "env.TAG is empty");

Expand All @@ -20,7 +20,7 @@ async function main(): Promise<void> {
console.log(`Starting release process for tag ${fgGreen(tag)}`);

const artifactUrl = await gh.getMPKReleaseArtifactUrl(tag);

console.log("artifact url ", artifactUrl);
const draft = await createDraft({
appName: marketplace.appName,
appNumber: marketplace.appNumber,
Expand All @@ -30,6 +30,8 @@ async function main(): Promise<void> {
artifactUrl
});

console.log("draft ", draft);

await publishDraft({ draftUUID: draft.UUID });
}

Expand Down
4 changes: 2 additions & 2 deletions automation/utils/src/api/contributor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async function fetchContributor<T = unknown>(method: "PATCH" | "POST", path: str
assert.ok(pass, "env.CPAPI_PASS is empty");

const Authorization = `Basic ${Buffer.from(`${user}:${pass}`).toString("base64")}`;

console.log("fetchContributor ", Authorization, openId);
return fetch<T>(method, `${url}/${path}`, body, {
OpenID: openId,
Authorization
Expand Down Expand Up @@ -134,7 +134,7 @@ export async function createDraft(params: CreateDraftParams): Promise<CreateDraf
ArtifactURL: artifactUrl
}
};

console.log("log body", body);
return fetchContributor("POST", `packages/${appNumber}/versions`, JSON.stringify(body));
} catch (error) {
if (error instanceof Error) {
Expand Down

0 comments on commit 4d8b1e5

Please sign in to comment.