1
0
Gerald 1 жил өмнө
parent
commit
038bcfd984

+ 3 - 4
.github/workflows/amo-download.yml

@@ -3,7 +3,7 @@ name: Download AMO signed unlisted package
 on:
   workflow_dispatch:
     inputs:
-      ref:
+      version:
         required: true
   repository_dispatch:
     types:
@@ -11,12 +11,10 @@ on:
 
 jobs:
   amo-download:
-    if: ${{ github.event.client_payload.ref || github.event.inputs.ref }}
+    if: ${{ github.event.client_payload.version || github.event.inputs.version }}
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v4
-        with:
-          ref: ${{ github.event.client_payload.ref || github.event.inputs.ref }}
 
       - uses: actions/setup-node@v3
         with:
@@ -27,6 +25,7 @@ jobs:
         env:
           ACTION_BUILD_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
           DISCORD_WEBHOOK_RELEASE: ${{ secrets.DISCORD_WEBHOOK_RELEASE }}
+          VERSION: ${{ github.event.client_payload.version || github.event.inputs.version }}
 
       - name: Download signed file and upload to GitHub release
         run: |

+ 1 - 1
scripts/action-helper.js

@@ -2,7 +2,7 @@ const core = require('@actions/core');
 const { getVersion, isBeta } = require('./version-helper');
 const { exec } = require('./common');
 
-const version = getVersion();
+const version = process.env.VERSION || getVersion();
 const beta = isBeta();
 const ci = process.argv.includes('ci');
 

+ 2 - 1
scripts/amo-upload.mjs

@@ -1,4 +1,4 @@
-import { rename, writeFile } from 'fs/promises';
+import { rename, writeFile, mkdir } from 'fs/promises';
 import { join } from 'path';
 import { signAddon } from 'amo-upload';
 import { readManifest, buildUpdatesList } from './manifest-helper.js';
@@ -53,6 +53,7 @@ ${releaseUrl}
   });
 
   const xpiFile = join(process.env.ASSETS_DIR, fileName);
+  await mkdir(process.env.ASSETS_DIR, { recursive: true });
   await rename(tempFile, xpiFile);
 
   const updates = await buildUpdatesList(version, url);