forked from btcsuite/btcd
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scripts to build zip archive containing binaries for windows
Remove travis configuration file Fix misc issues Add operating system name to the name of each built artifact Fix typo Fix name to artifact to be uploaded Move windows archive is to the root of the workspace
- Loading branch information
1 parent
a2932c2
commit a8e3f8d
Showing
6 changed files
with
116 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
function build() { | ||
cd "${GITHUB_WORKSPACE}" || exit | ||
|
||
source ./do GOOS=windows GOARCH=amd64 | ||
|
||
mkdir ./bin/bin | ||
|
||
mv ./bin/*.exe ./bin/bin | ||
|
||
cd bin || exit | ||
|
||
zip -r "./${RELEASE_NAME}-win.zip" ./bin | ||
|
||
mv -v "./${RELEASE_NAME}-win.zip" "${GITHUB_WORKSPACE}"'/'"${RELEASE_NAME}"'-win.zip' | ||
} | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
function publish() { | ||
local archive | ||
archive="${1}" | ||
|
||
local extension | ||
extension="${2}" | ||
|
||
if [ ! -e "${archive}" ]; | ||
then | ||
echo 'Invalid archive ('"${archive}"')' | ||
return 1 | ||
fi | ||
|
||
local checksum | ||
checksum="$(sha256sum "${archive}" | cut -d ' ' -f 1)" | ||
|
||
local base_url | ||
base_url='https://api.github.com/repos/'"${GITHUB_REPOSITORY}" | ||
|
||
local upload_url | ||
upload_url="$(curl \ | ||
-H 'Content-Type: application/octet-stream' \ | ||
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ | ||
"${base_url}"/releases 2>> /dev/null | \ | ||
jq -r '.[] | .upload_url' | \ | ||
head -n1)" | ||
|
||
upload_url=${upload_url/\{?name,label\}/} | ||
|
||
local release_name | ||
release_name="$(curl \ | ||
-H 'Content-Type: application/octet-stream' \ | ||
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ | ||
"${base_url}"/releases 2>> /dev/null | \ | ||
jq -r '.[] | .tag_name' | \ | ||
head -n1)" | ||
|
||
curl \ | ||
-X POST \ | ||
--data-binary @${archive} \ | ||
-H 'Content-Type: application/octet-stream' \ | ||
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ | ||
"${upload_url}?name=${release_name}-windows${extension}" | ||
|
||
curl \ | ||
-X POST \ | ||
--data "$checksum" \ | ||
-H 'Content-Type: text/plain' \ | ||
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ | ||
"${upload_url}?name=${release_name}-windows${extension}.sha256sum" | ||
} | ||
|
||
publish "${GITHUB_WORKSPACE}"'/'"${RELEASE_NAME}"'-win.zip' '.zip' |