mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-13 22:48:43 +03:00
ShippableCI: Add integration tests, dub/dlang tools and package upload
This commit is contained in:
parent
1b17d11a81
commit
7b842a765b
3 changed files with 94 additions and 12 deletions
22
tools/upload-to-github.sh
Executable file
22
tools/upload-to-github.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "Usage: $0 <tag> <file> (and GITHUB_TOKEN environment variable)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
releaseTag=$1
|
||||
artifact=$2
|
||||
artifactFilename=$(basename $artifact)
|
||||
|
||||
releaseID="$(bash -c "curl -s https://api.github.com/repos/ldc-developers/ldc/releases/tags/$releaseTag | grep -m 1 '^ \"id\":'")"
|
||||
releaseID=${releaseID:8:-1}
|
||||
|
||||
echo "Uploading $artifact to GitHub release $releaseTag ($releaseID)..."
|
||||
curl -s \
|
||||
-H "Authorization: token $GITHUB_TOKEN" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary @$artifact \
|
||||
https://uploads.github.com/repos/ldc-developers/ldc/releases/$releaseID/assets?name=$artifactFilename
|
Loading…
Add table
Add a link
Reference in a new issue