Skip to content

Commit d3354ca

Browse files
rebuild flat-manager
1 parent 19641d3 commit d3354ca

File tree

1 file changed

+33
-29
lines changed

1 file changed

+33
-29
lines changed

flat-manager/dist/index.js

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,44 @@ const exec = __webpack_require__(922)
1212
const LOCAL_REPO_NAME = "repo"
1313

1414

15-
const run = async (repository, flatManagerUrl, token) => {
16-
await exec.exec('flatpak', [
15+
const run = (repository, flatManagerUrl, token) => {
16+
exec.exec('flatpak', [
1717
'build-update-repo',
1818
'--generate-static-deltas',
1919
LOCAL_REPO_NAME,
2020
])
21-
22-
const buildId = await exec.exec('flat-manager-client', [
23-
'create',
24-
flatManagerUrl,
25-
repository,
26-
'--token',
27-
token
28-
])
29-
30-
exec.exec('flat-manager-client', [
31-
'push',
32-
'--commit',
33-
'--publish',
34-
'--wait',
35-
'--token',
36-
token,
37-
buildId,
38-
LOCAL_REPO_NAME,
39-
]).then(() => {
40-
core.info(`Build published successfully: ${buildId}`)
41-
}).catch((err) => {
42-
core.setFailed(`Failed to commit the build: ${err}`)
21+
.then(async () => {
22+
const buildId = await exec.exec('flat-manager-client', [
23+
'create',
24+
flatManagerUrl,
25+
repository,
26+
'--token',
27+
token
28+
])
29+
return buildId
30+
})
31+
.then(async (buildId) => {
32+
await exec.exec('flat-manager-client', [
33+
'push',
34+
'--commit',
35+
'--publish',
36+
'--wait',
37+
'--token',
38+
token,
39+
buildId,
40+
LOCAL_REPO_NAME,
41+
])
42+
return buildId
43+
})
44+
.then(async (buildId) => {
45+
await exec.exec('flat-manager-client', [
46+
'purge',
47+
buildId,
48+
])
49+
})
50+
.catch((err) => {
51+
core.setFailed(`Failed to publish the build: ${err}`)
4352
})
44-
45-
await exec.exec('flat-manager-client', [
46-
'purge',
47-
buildId,
48-
])
4953
}
5054

5155
if (require.main === require.cache[eval('__filename')]) {

0 commit comments

Comments
 (0)