From ecabf33ac3cd4b8274f98258ca060da46a9a3e51 Mon Sep 17 00:00:00 2001 From: lucasfernog Date: Sun, 12 Jul 2020 15:27:17 +0000 Subject: [PATCH] [create-pull-request] automated change --- .changes/build-action-on-preversion.md | 5 ----- .changes/custom-script.md | 5 ----- .changes/debug-build.md | 5 ----- CHANGELOG.md | 9 +++++++++ dist/main.js | 13 +++++++++---- package.json | 2 +- 6 files changed, 19 insertions(+), 20 deletions(-) delete mode 100644 .changes/build-action-on-preversion.md delete mode 100644 .changes/custom-script.md delete mode 100644 .changes/debug-build.md diff --git a/.changes/build-action-on-preversion.md b/.changes/build-action-on-preversion.md deleted file mode 100644 index c579a3296..000000000 --- a/.changes/build-action-on-preversion.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"action": patch ---- - -Build action on preversion so we can't forget to build when a version is updated. diff --git a/.changes/custom-script.md b/.changes/custom-script.md deleted file mode 100644 index 6ed233cf8..000000000 --- a/.changes/custom-script.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"action": patch ---- - -Adds an option to run a custom package.json script with the `npmScript` input. diff --git a/.changes/debug-build.md b/.changes/debug-build.md deleted file mode 100644 index c6eae573d..000000000 --- a/.changes/debug-build.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"action": patch ---- - -Adds an option to include a debug build with the `includeDebug` (bool) input. diff --git a/CHANGELOG.md b/CHANGELOG.md index ac9f5a5cd..46eea6ea0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [0.0.3] + +- Build action on preversion so we can't forget to build when a version is updated. + - [af79aee](https://github.com/tauri-apps/tauri-action/commit/af79aee2e0022f4402f619d1177e63596f8c950c) chore: build action on version ([#7](https://github.com/tauri-apps/tauri-action/pull/7)) on 2020-07-12 +- Adds an option to run a custom package.json script with the npmScript input. + - [f91ad8d](https://github.com/tauri-apps/tauri-action/commit/f91ad8dc315e9d911f3351bead517b35b89a1e6f) feat(action) add option to run custom package.json script ([#8](https://github.com/tauri-apps/tauri-action/pull/8)) on 2020-07-12 +- Adds an option to include a debug build with the includeDebug (bool) input. + - [a6b824c](https://github.com/tauri-apps/tauri-action/commit/a6b824c578593003332957fa899c354c40e20df5) feat(action) add option to include a debug build ([#6](https://github.com/tauri-apps/tauri-action/pull/6)) on 2020-07-12 + ## [0.0.2] - Implement covector for change management and git tag creation. diff --git a/dist/main.js b/dist/main.js index 7c9333339..e99bbef6b 100644 --- a/dist/main.js +++ b/dist/main.js @@ -66,12 +66,16 @@ function execCommand(command, { cwd }) { env: { FORCE_COLOR: '0' }, }).then(); } -function buildProject(root, debug, { configPath, distPath, iconPath }) { +function buildProject(root, debug, { configPath, distPath, iconPath, npmScript }) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve) => { if (hasTauriDependency(root)) { - const runner = usesYarn(root) ? 'yarn tauri' : 'npx tauri'; - resolve(runner); + if (npmScript) { + resolve(usesYarn(root) ? `yarn ${npmScript}` : `npm run ${npmScript}`); + } + else { + resolve(usesYarn(root) ? 'yarn tauri' : 'npx tauri'); + } } else { execCommand('npm install -g tauri', { cwd: undefined }).then(() => resolve('tauri')); @@ -156,6 +160,7 @@ function run() { const distPath = core.getInput('distPath'); const iconPath = core.getInput('iconPath'); const includeDebug = core.getInput('includeDebug') === 'true'; + const npmScript = core.getInput('npmScript'); let tagName = core.getInput('tagName').replace('refs/tags/', ''); let releaseName = core.getInput('releaseName').replace('refs/tags/', ''); let body = core.getInput('releaseBody'); @@ -165,7 +170,7 @@ function run() { if (Boolean(tagName) !== Boolean(releaseName)) { throw new Error('`tag` is required along with `releaseName` when creating a release.'); } - const options = { configPath: fs_1.existsSync(configPath) ? configPath : null, distPath, iconPath }; + const options = { configPath: fs_1.existsSync(configPath) ? configPath : null, distPath, iconPath, npmScript }; const artifacts = yield buildProject(projectPath, false, options); if (includeDebug) { const debugArtifacts = yield buildProject(projectPath, true, options); diff --git a/package.json b/package.json index f5de7f911..b0e939ce1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tauri-action", - "version": "0.0.2", + "version": "0.0.3", "description": "Tauri GitHub Action", "main": "dist/index.js", "scripts": {