Skip to content

Commit

Permalink
Yet another attempt to fix pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Exidex committed Jun 16, 2024
1 parent 5144383 commit 56626c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/setup-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- run: sudo apt-get install -y protobuf-compiler

- uses: actions/checkout@v4
- run: git pull
- uses: actions/setup-node@v4
with:
node-version: 18
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/setup-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
echo Killing XProtect.; sudo pkill -9 XProtect >/dev/null || true;
- uses: actions/checkout@v4
- run: git pull
- uses: actions/setup-node@v4
with:
node-version: 18
Expand Down
14 changes: 4 additions & 10 deletions js/build/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ async function makeRepoChanges(projectRoot: string): Promise<{ releaseNotes: str
const git = simpleGit(projectRoot);

console.log("Reading version file...")
const newVersion = await readNewVersion(projectRoot)
const oldVersion = await readVersion(projectRoot)

const newVersion = oldVersion + 1;

console.log("Writing version file...")
await writeVersion(projectRoot, newVersion)
Expand Down Expand Up @@ -295,7 +297,7 @@ async function packageForMacos(projectRoot: string, arch: string): Promise<{ fil

const dmgBackground = path.join(projectRoot, 'assets', 'dmg-background.png');

const version = await readNewVersion(projectRoot)
const version = await readVersion(projectRoot)

mkdirSync(bundleDir)
mkdirSync(contentsDir)
Expand Down Expand Up @@ -409,14 +411,6 @@ function getGithubReleaseId() {
return Number(process.env.GITHUB_RELEASE_ID!!)
}

async function readNewVersion(projectRoot: string) {
// this is old version because actions/checkout@v4 clones the ref
// which triggered the workflow and not the latest which has updated version file
const oldVersion = await readVersion(projectRoot)

return oldVersion + 1
}

async function readVersion(projectRoot: string): Promise<number> {
const versionFilePath = path.join(projectRoot, "VERSION");
const versionRaw = await readFile(versionFilePath, { encoding: "utf-8" });
Expand Down

0 comments on commit 56626c5

Please sign in to comment.