From d350d11cb3f54bbf2c906f438d0e142646d3516f Mon Sep 17 00:00:00 2001 From: LynithDev <61880709+LynithDev@users.noreply.github.com> Date: Mon, 16 Sep 2024 20:01:32 +0200 Subject: [PATCH] fix: Attempt to fix build CI --- .../actions/publish-artifacts/src/index.ts | 21 ++++++++++++++++++- .../{release.yml => build_artifacts.yml} | 4 +++- 2 files changed, 23 insertions(+), 2 deletions(-) rename .github/workflows/{release.yml => build_artifacts.yml} (98%) diff --git a/.github/actions/publish-artifacts/src/index.ts b/.github/actions/publish-artifacts/src/index.ts index eb9efbbb..d9a30ec8 100644 --- a/.github/actions/publish-artifacts/src/index.ts +++ b/.github/actions/publish-artifacts/src/index.ts @@ -57,8 +57,10 @@ const os: OS = getInput('os'); const arch: Arch = getInput('arch'); const profile: Profile = getInput('profile'); const target = getInput('target'); +const binaryName = getInput('binary'); -const bundleDir = `target/${target}/${profile}/bundle`; +const targetDir = `target/${target}`; +const bundleDir = `${targetDir}/${profile}/bundle`; const artifactsDir = '.artifacts'; const artifactBase = `OneLauncher-${os}-${arch}`; const frontendBundle = 'apps/frontend/dist.tar.xz'; @@ -111,6 +113,22 @@ async function uploadStandalone({ bundle, ext }: TargetConfig) { await client.uploadArtifact(artifactName, [artifactPath], artifactsDir); } +async function uploadBinary() { + if (typeof binaryName !== 'string') + return; + + const file = binaryName || 'onelauncher_gui'; + const binaryPath = `${targetDir}/${file}`; + + if (!(await exists(binaryPath))) { + console.error('binary missing!'); + return; + } + + await io.cp(binaryPath, `${artifactsDir}/${file}`); + await client.uploadArtifact(file, [`${artifactsDir}/${file}`], artifactsDir); +} + async function run() { await io.mkdirP(artifactsDir); const { updater, standalone } = osTargets[os]; @@ -118,6 +136,7 @@ async function run() { await Promise.all([ uploadUpdater(updater), uploadFrontend(), + uploadBinary(), ...standalone.map(uploadStandalone), ]); } diff --git a/.github/workflows/release.yml b/.github/workflows/build_artifacts.yml similarity index 98% rename from .github/workflows/release.yml rename to .github/workflows/build_artifacts.yml index b08edb5f..619e62de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/build_artifacts.yml @@ -1,4 +1,4 @@ -name: Release +name: Build Artifacts on: pull_request: @@ -37,8 +37,10 @@ jobs: bundles: deb os: linux arch: x86_64 + binary: onelauncher_gui name: Desktop (${{ matrix.settings.target }}) runs-on: ${{ matrix.settings.host }} + continue-on-error: true steps: - name: (Linux) Maximize build space if: ${{ runner.os == 'Linux' }}