diff --git a/.changeset/sour-wombats-hope.md b/.changeset/sour-wombats-hope.md new file mode 100644 index 0000000..1040859 --- /dev/null +++ b/.changeset/sour-wombats-hope.md @@ -0,0 +1,5 @@ +--- +'build-uploader': patch +--- + +Updated logs, some type fixes diff --git a/scripts/release.ts b/scripts/release.ts index 478e819..a0be00a 100644 --- a/scripts/release.ts +++ b/scripts/release.ts @@ -49,6 +49,32 @@ const main = async () => { stdio: 'inherit', }); + const [major, minor] = version.split('.'); + const majorTag = `v${major}`; + const minorTag = `v${major}.${minor}`; + + try { + execSync(`git tag -f ${majorTag}`, { stdio: 'inherit' }); + + execSync(`git push origin ${majorTag} --force`, { + stdio: 'inherit', + }); + console.log(`Updated tag: ${majorTag}`); + } catch (error: any) { + console.error(`Failed to update ${majorTag}:`, error.message); + } + + try { + execSync(`git tag -f ${minorTag}`, { stdio: 'inherit' }); + + execSync(`git push origin ${minorTag} --force`, { + stdio: 'inherit', + }); + console.log(`Updated tag: ${minorTag}`); + } catch (error: any) { + console.error(`Failed to update ${minorTag}:`, error.message); + } + execSync( `gh release create v${version} --title "v${version}" --notes "${releaseNotes || 'No changes'}"`, { @@ -57,8 +83,8 @@ const main = async () => { ); console.log(`Successfully created and pushed release v${version}`); - } catch (error) { - console.error('Error creating release:', (error as Error).message); + } catch (error: any) { + console.error('Error creating release:', error.message); process.exit(1); } }; diff --git a/src/index.ts b/src/index.ts index 0007cb5..88c3c4c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,8 +2,10 @@ import * as core from '@actions/core'; import { run } from './run'; run() - .then(() => { - core.info('Build upload process completed successfully'); + .then((buildId) => { + core.info( + `Build upload process completed successfully for build ID: ${buildId}` + ); }) .catch((error) => { core.setFailed(`Unable to upload build due to error: ${error.message}`); diff --git a/src/run.ts b/src/run.ts index deb6869..db3dc03 100644 --- a/src/run.ts +++ b/src/run.ts @@ -5,14 +5,14 @@ import { createBuild } from './createBuild'; import { uploadBuild } from './uploadBuild'; import { completeBuild } from './completeBuild'; -export async function run() { +export async function run(): Promise { const apiKey = core.getInput('apiKey', { required: true }); const apiBaseUrl = core.getInput('apiBaseUrl', { required: true }); const gameId = core.getInput('gameId', { required: true }); - const windowsBuildPath: string | null = core.getInput('windowsBuildPath', { + const windowsBuildPath = core.getInput('windowsBuildPath', { required: false, }); - const macosBuildPath: string | null = core.getInput('macosBuildPath', { + const macosBuildPath = core.getInput('macosBuildPath', { required: false, }); @@ -75,4 +75,5 @@ export async function run() { }); core.setOutput('buildId', buildId); + return buildId; }