Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustav-Eikaas committed Nov 5, 2024
1 parent ae87417 commit c469fee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions github-action/src/releasePr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ await program.parseAsync();

export async function release(context: ReleaseArgs) {
prepareBundle();
makeManifest('./package.json');
const manifest = makeManifest('./package.json');
const zipped = zipBundle();
const r = parsePackageJson();
if (!r.name) {
throw new Error(
`No name in package json, cannot deploy unknown app at path ${process.cwd()}`
);
}
await uploadBundle(ciUrl, context.token, r.name, zipped);
await uploadBundle(ciUrl, context.token, r.name, zipped, manifest.version);
console.log("Skipping patchAppConfig");
// await patchAppConfig(
// {
Expand Down
3 changes: 2 additions & 1 deletion github-action/src/utils/makeManifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function makeManifest(path: string) {
//required
entryPoint: "app-bundle.js",
//required
version: "1.0.5"
version: "1.0.6"
//TODO: add commit sha and github repo
//timestamp: "string",
//commitSha: "string",
Expand All @@ -23,5 +23,6 @@ export function makeManifest(path: string) {
const data = JSON.stringify(manifest, null, 2);

fs.writeFileSync('./dist/app-manifest.json', data);
return manifest
}

7 changes: 4 additions & 3 deletions github-action/src/utils/uploadBundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export async function uploadBundle(
baseUrl: string,
token: string,
appKey: string,
zipped: AdmZip
zipped: AdmZip,
version: string
) {
const client = new HttpClient();

Expand Down Expand Up @@ -41,9 +42,9 @@ export async function uploadBundle(
}

/** Publish bundle */
const publishResponse = await client.post(
const publishResponse = await client.put(
`${baseUrl}/apps/${appKey}/tags/latest`,
'',
JSON.stringify({ version: version }),
{
['Authorization']: `Bearer ${token}`,
["Content-Type"]: 'application/json',
Expand Down

0 comments on commit c469fee

Please sign in to comment.