Skip to content

Commit 1f7281b

Browse files
authored
Update deploy.js
1 parent e91b2fa commit 1f7281b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

scripts/deploy.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ const UPLOAD_RELEASE_URL = `https://uploads.github.com/repos/${REPO}/releases/{i
3939

4040
const RELEASE_BODY = `Released at {date}\r\n\r\nRelease for commit: https://github.com/uEssentials/uEssentials/commit/${COMMIT} (${process.env['APPVEYOR_REPO_COMMIT_MESSAGE']})`;
4141

42+
let shortSha = COMMIT.substring(0, 7);
43+
4244
function createRelease(version) {
4345
let res = request('POST', CREATE_RELEASE_URL, {
4446
headers: {
@@ -55,6 +57,7 @@ function createRelease(version) {
5557
});
5658
if (res.body.toString().indexOf('already_exists') > -1) {
5759
console.log(`Release for commit ${COMMIT} already exists. Exiting...`);
60+
fs.writeFileSync('download_url', `https://github.com/uEssentials/Builds/releases/tag/build-${shortSha}`);
5861
process.exit(0);
5962
}
6063
return JSON.parse(res.getBody('utf8'));
@@ -94,8 +97,6 @@ request('PUT', `https://api.github.com/repos/${REPO}/contents/README.md?access_t
9497
});
9598

9699
// Create release & upload asset
97-
let shortSha = COMMIT.substring(0, 7);
98-
99100
uploadAsset(createRelease(`build-${shortSha}`), 'deploy/uEssentials.zip', `uEssentials-build-${shortSha}.zip`);
100101

101102
// Add 'Download available' status

0 commit comments

Comments
 (0)