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' }}