Skip to content

Commit a72f601

Browse files
committed
Revert workflow changes
1 parent acd6fef commit a72f601

File tree

3 files changed

+21
-41
lines changed

3 files changed

+21
-41
lines changed

.github/actions/release.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ declare global {
1616

1717
const dirname = path.dirname(fileURLToPath(import.meta.url))
1818
const envPath = path.join(dirname, '..', '..', '.env')
19+
const tauriConfPath = path.join(dirname, '..', '..', 'src-tauri', 'tauri.conf.json')
1920
const packageJsonPath = path.join(dirname, '..', '..', 'package.json')
2021
const token = process.env.GITHUB_TOKEN
2122
const secret = process.env.CLIENT_SECRET
@@ -27,10 +28,17 @@ VITE_CLIENT_ID=${id}
2728
`
2829

2930
async function run() {
31+
const tauriConf = JSON.parse(
32+
await fs.readFile(tauriConfPath, 'utf-8'),
33+
) as typeof import('../../src-tauri/tauri.conf.json')
34+
3035
const packageJSON = JSON.parse(
3136
await fs.readFile(packageJsonPath, 'utf-8'),
3237
) as typeof import('../../package.json')
3338

39+
if (packageJSON.version !== tauriConf.package.version)
40+
throw new Error('Tauri config and Package JSON versions are not the same, update both of them!')
41+
3442
const dmgFileName = `Gitification_${packageJSON.version}_universal.dmg`
3543

3644
const dmgPath = path.join(
@@ -48,6 +56,19 @@ async function run() {
4856

4957
const octokit = github.getOctokit(token)
5058

59+
try {
60+
const remoteRelease = await octokit.rest.repos.getLatestRelease({
61+
owner: 'Gitification-App',
62+
repo: 'gitification',
63+
})
64+
65+
if (remoteRelease.data.name === packageJSON.version.toString()) {
66+
console.log('No version change detected, skipping build.')
67+
return
68+
}
69+
}
70+
catch { /* If endpoint throws, it means no release yet */ }
71+
5172
await fs.writeFile(envPath, envFileContent, 'utf-8')
5273
await execaCommand('pnpm tauri build --target universal-apple-darwin', { stdio: 'inherit' })
5374

.github/actions/version.ts

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ jobs:
4444
4545
- name: Install dependencies
4646
run: pnpm install
47-
48-
- name: Check version change
49-
run: pnpx tsx .github/actions/version.ts
5047

5148
- name: install Rust stable
5249
uses: dtolnay/rust-toolchain@stable
@@ -59,4 +56,3 @@ jobs:
5956
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
6057
CLIENT_ID: ${{ secrets.CLIENT_ID }}
6158
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62-

0 commit comments

Comments
 (0)