Skip to content

Commit

Permalink
ci: fix action syntax, adjust version path
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed May 14, 2024
1 parent f7ae401 commit 9dd13ad
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/actions/daemon-update/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
6 changes: 5 additions & 1 deletion hostd/main/binary.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions hostd/main/daemon.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down Expand Up @@ -61,7 +61,7 @@ export function getIsDaemonRunning(): boolean {
}

export async function getInstalledVersion(): Promise<string> {
const versionFilePath = path.join(getBinaryDirectoryPath(), 'version')
const versionFilePath = path.join(getDaemonDirectoryPath(), 'version')
try {
const version = await fs.promises.readFile(versionFilePath, 'utf8')
return version
Expand Down
6 changes: 5 additions & 1 deletion renterd/main/binary.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions renterd/main/daemon.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down Expand Up @@ -62,7 +62,7 @@ export function getIsDaemonRunning(): boolean {
}

export async function getInstalledVersion(): Promise<string> {
const versionFilePath = path.join(getBinaryDirectoryPath(), 'version')
const versionFilePath = path.join(getDaemonDirectoryPath(), 'version')
try {
const version = await fs.promises.readFile(versionFilePath, 'utf8')
return version
Expand Down

0 comments on commit 9dd13ad

Please sign in to comment.