From 9dd13ad06d649ac4f6b29f55308fd21fa0e796aa Mon Sep 17 00:00:00 2001 From: Alex Freska Date: Tue, 14 May 2024 10:22:16 -0400 Subject: [PATCH] ci: fix action syntax, adjust version path --- .github/actions/daemon-update/action.yml | 6 +++--- hostd/main/binary.ts | 6 +++++- hostd/main/daemon.ts | 4 ++-- renterd/main/binary.ts | 6 +++++- renterd/main/daemon.ts | 4 ++-- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/actions/daemon-update/action.yml b/.github/actions/daemon-update/action.yml index 5814449..7c55041 100644 --- a/.github/actions/daemon-update/action.yml +++ b/.github/actions/daemon-update/action.yml @@ -53,7 +53,7 @@ runs: echo "'${{ inputs.daemon }}': minor" >> $FILE echo '---' >> $FILE echo '' >> $FILE - echo "The daemon version has been updated to ${{ steps.latest-release.outputs.version }}" >> $FILE + echo "The daemon version has been updated to ${{ steps.latest-release.outputs.version }}." >> $FILE echo '' >> $FILE - name: Set PR Branch Name @@ -67,8 +67,8 @@ runs: uses: peter-evans/create-pull-request@v5 with: token: ${{ inputs.token }} - commit-message: '$${{ inputs.daemon }}: ${{ steps.latest-release.outputs.version }}"' - title: '${{ inputs.daemon }}: ${{ steps.latest-release.outputs.version }}"' + commit-message: '${{ inputs.daemon }}: ${{ steps.latest-release.outputs.version }}' + title: '${{ inputs.daemon }}: ${{ steps.latest-release.outputs.version }}' body: ${{ steps.latest-release.outputs.release_notes }} branch: ${{ env.branch_name }} delete-branch: true diff --git a/hostd/main/binary.ts b/hostd/main/binary.ts index b642497..c18c0dc 100644 --- a/hostd/main/binary.ts +++ b/hostd/main/binary.ts @@ -1,8 +1,12 @@ import * as path from 'path' import { getResourcePath } from './asset' +export function getDaemonDirectoryPath(): string { + return getResourcePath('daemon') +} + export function getBinaryDirectoryPath(): string { - return getResourcePath('daemon/bin') + return path.join(getDaemonDirectoryPath(), 'bin') } export function getBinaryFilePath(): string { diff --git a/hostd/main/daemon.ts b/hostd/main/daemon.ts index ae30464..96feab8 100644 --- a/hostd/main/daemon.ts +++ b/hostd/main/daemon.ts @@ -1,7 +1,7 @@ import { spawn } from 'child_process' import { state } from './state' import { getConfig, getConfigFilePath } from './config' -import { getBinaryDirectoryPath, getBinaryFilePath } from './binary' +import { getBinaryFilePath, getDaemonDirectoryPath } from './binary' import path from 'path' import fs from 'fs' @@ -61,7 +61,7 @@ export function getIsDaemonRunning(): boolean { } export async function getInstalledVersion(): Promise { - const versionFilePath = path.join(getBinaryDirectoryPath(), 'version') + const versionFilePath = path.join(getDaemonDirectoryPath(), 'version') try { const version = await fs.promises.readFile(versionFilePath, 'utf8') return version diff --git a/renterd/main/binary.ts b/renterd/main/binary.ts index ca1ad5b..81b320f 100644 --- a/renterd/main/binary.ts +++ b/renterd/main/binary.ts @@ -1,8 +1,12 @@ import * as path from 'path' import { getResourcePath } from './asset' +export function getDaemonDirectoryPath(): string { + return getResourcePath('daemon') +} + export function getBinaryDirectoryPath(): string { - return getResourcePath('daemon/bin') + return path.join(getDaemonDirectoryPath(), 'bin') } export function getBinaryFilePath(): string { diff --git a/renterd/main/daemon.ts b/renterd/main/daemon.ts index 2cd4893..b234dda 100644 --- a/renterd/main/daemon.ts +++ b/renterd/main/daemon.ts @@ -1,7 +1,7 @@ import { spawn } from 'child_process' import { state } from './state' import { getConfig, getConfigFilePath } from './config' -import { getBinaryDirectoryPath, getBinaryFilePath } from './binary' +import { getBinaryFilePath, getDaemonDirectoryPath } from './binary' import path from 'path' import fs from 'fs' @@ -62,7 +62,7 @@ export function getIsDaemonRunning(): boolean { } export async function getInstalledVersion(): Promise { - const versionFilePath = path.join(getBinaryDirectoryPath(), 'version') + const versionFilePath = path.join(getDaemonDirectoryPath(), 'version') try { const version = await fs.promises.readFile(versionFilePath, 'utf8') return version