Skip to content

Commit

Permalink
nightly builds: migrate from bintray to cloudsmith
Browse files Browse the repository at this point in the history
  • Loading branch information
palxex committed Apr 1, 2021
1 parent 4013895 commit 9244437
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 110 deletions.
35 changes: 8 additions & 27 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ version: 2.0.{build}
image:
- Visual Studio 2019
environment:
#since appveyor official binding for bintray lacks of ability to specify upload path, we'd to use the manual curl way
BINTRAY_APIKEY:
secure: s4sB+aNp/xHO4oiFNkZ84OOewXOCUMmDIychhJYcXzJ+Exdj1+WJRXQisXgOYHpY
CLOUDSMITH_API_KEY:
secure: gryxZxQ1A85JeBI+HHk8GQqY/RQ4y8Oq8kR3yZ2v9zmtnUEmtPmkARFfoypUO0K8
matrix:
- solution_name: win32/sdlpal.sln
APPX_OPTIONS:
Expand All @@ -19,39 +18,21 @@ before_build:
cd winrt
if "%solution_name%"=="winrt/SDLPal.UWP.sln" nuget restore SDLPal.UWP.sln
cd ..
pip install cloudsmith-cli
after_build:
- |-
if exist win32\Win32\Release\sdlpal.exe ( cd win32\Win32\Release & 7z a ..\..\..\sdlpal-win32-msvc.zip sdlpal.exe & cd ..\..\..\ )
for /d %%d in ("winrt\SDLPal.UWP\AppPackages\*") do ( cd %%d & del /q *.appxsym & 7z a ..\..\..\..\sdlpal-uwp.zip * & cd ..\..\..\..\ )
- ps: >-
if([string]::IsNullOrEmpty($env:APPVEYOR_PULL_REQUEST_NUMBER)) {
$COMMIT_DATE=((git show -s --format=%cs)|out-string).trim()
$REV=((git rev-list --count HEAD)|out-string).trim()
$COMMIT_ID=((git rev-parse --short HEAD)|out-string).trim()
$VERSION="v$COMMIT_DATE-g$COMMIT_ID"
$BINTRAY_USER="palxex"
$BINTRAY_REPO="sdlpal/nightly"
$BINTRAY_PATH="$BINTRAY_REPO/$env:APPVEYOR_REPO_BRANCH"
# remove notorious PS curl alias to use the built-in one
remove-item alias:curl
# create package
curl -fsS -u "${BINTRAY_USER}:${env:BINTRAY_APIKEY}" -X POST -d "{\""name\"":\""$env:APPVEYOR_REPO_BRANCH\"", \""desc\"": \""I was pushed completely automatically\"", \""labels\"": [\""game\"", \""c\"", \""rpg\""], \""licenses\"": [\""GPL-3.0\""], \""vcs_url\"": \""https://github.com/sdlpal/sdlpal.git\"", \""website_url\"": \""https://sdlpal.github.io\"", \""issue_tracker_url\"": \""https://github.com/sdlpal/sdlpal/issues\"", \""github_repo\"": \""sdlpal/sdlpal\"", \""public_download_numbers\"": true, \""public_stats\"": true}" "https://api.bintray.com/packages/$BINTRAY_REPO" -H "Content-Type: application/json"
# create version
$DESC=$env:APPVEYOR_REPO_COMMIT_MESSAGE
$RELEASE_DATE=(git show -s --format=%cI)
$VCS_TAG=(git describe --tags)
$AUTHOR=(git show -s --format=%an)
$AUTHOR_DATE=(git show -s --format=%ai)
$CIMMITER=(git show -s --format=%cn)
$BRANCH=$env:APPVEYOR_REPO_BRANCH
$COMMITID=(git show -s --format=%h)
curl -fsS -u "${BINTRAY_USER}:${env:BINTRAY_APIKEY}" -X POST -d "{\""name\"":\""$VERSION\"", \""desc\"": \""$DESC\"", \""released\"": \""$RELEASE_DATE\"", \""vcs_t ag\"": \""$VCS_TAG\"", \""attributes\"": [ {\""name\"": \""Author\"",\""values\"" : [\""$AUTHOR\""], \""type\"": \""string\""}, {\""name\"": \""AuthorDate\"",\""values\"" : [\""$AUTHOR_DATE\""], \""type\"": \""string\""}, {\""name\"": \""Commiter\"",\""values\"" : [\""$CIMMITER\""], \""type\"": \""string\""}, {\""name\"": \""Branch\"",\""values\"" : [\""$BRANCH\""], \""type\"": \""string\""}, {\""name\"": \""CommitID\"", \""values\"" : [\""$COMMITID\""], \""type\"": \""string\""} ]}" "https://api.bintray.com/packages/$BINTRAY_PATH/versions" -H "Content-Type: application/json"
$VERSION="v$COMMIT_DATE-r$REV-g$COMMIT_ID"
# upload artifacts
@("sdlpal-win32-msvc.zip","sdlpal-uwp.zip") | ForEach-Object -Process { if (Test-Path ${_}) { curl -fsS -u "${BINTRAY_USER}:${env:BINTRAY_APIKEY}" -X PUT "https://api.bintray.com/content/$BINTRAY_PATH/$VERSION/$VERSION/${_}?override=1&publish=1" -T "${_}" } }
curl -fsS -u "${BINTRAY_USER}:${env:BINTRAY_APIKEY}" -X POST "https://api.bintray.com/packages/$BINTRAY_PATH/versions/$VERSION/attributes" -H "Content-Type: application/json" -d "[ {\""name\"": \""Author\"", \""values\"" : [\""$(git show -s --format=%an)\""], \""type\"": \""string\""}, {\""name\"": \""AuthorDate\"", \""values\"" : [\""$(git show -s --format=%ai)\""], \""type\"": \""string\""}, {\""name\"": \""Commiter\"", \""values\"" : [\""$(git show -s --format=%cn)\""], \""type\"": \""string\""}, {\""name\"": \""Branch\"", \""values\"" : [\""${env:APPVEYOR_REPO_BRANCH}\""], \""type\"": \""string\""}, {\""name\"": \""CommitID\"", \""values\"" : [\""$(git show -s --format=%h)\""], \""type\"": \""string\""}]"
# Wait publishing PUT processing; the latter PUT, list_in_downloads, only has effect after publish done.
start-sleep -s 10
@("sdlpal-win32-msvc.zip","sdlpal-uwp.zip") | ForEach-Object -Process { if (Test-Path ${_}) { curl -gsS -u "${BINTRAY_USER}:${env:BINTRAY_APIKEY}" -X PUT "https://api.bintray.com/file_metadata/$BINTRAY_REPO/$VERSION/${_}" -H "Content-Type: application/json" -d '{\"list_in_downloads\": true}' } }
}
if (Test-Path "sdlpal-win32-msvc.zip") { cloudsmith upload raw sdlpal/sdlpal "sdlpal-win32-msvc.zip" --version $VERSION --name win32-msvc --republish --tags "branch/$env:APPVEYOR_REPO_BRANCH"}
if (Test-Path "sdlpal-uwp.zip") { cloudsmith upload raw sdlpal/sdlpal "sdlpal-uwp.zip" --version $VERSION --name UWP --republish --tags "branch/$env:APPVEYOR_REPO_BRANCH"}
}
deploy:
- provider: GitHub
Expand Down
70 changes: 31 additions & 39 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
language: c
os: linux

git:
depth: false

env:
global:
- CACHE=$HOME/.sdlpal-caches
- PIP=pip

cache:
directories:
Expand All @@ -16,7 +20,7 @@ jobs:
fast_finish: true
include:
- os: linux
env: TARGET=AppImage
env: TARGET=AppImage EXT=AppImage
addons:
apt:
packages:
Expand All @@ -32,7 +36,7 @@ jobs:
- cd ..

- os: linux
env: TARGET=MinGW32 SDL2_VERSION=2.0.14
env: TARGET=MinGW32 SDL2_VERSION=2.0.14 EXT=zip
addons:
apt:
packages:
Expand Down Expand Up @@ -67,7 +71,7 @@ jobs:
- cd ..

- os: linux
env: TARGET=MinGW32-armv7 SDL2_VERSION=2.0.14-armv7
env: TARGET=MinGW32-armv7 SDL2_VERSION=2.0.14-armv7 EXT=zip
addons:
apt:
packages:
Expand Down Expand Up @@ -122,7 +126,7 @@ jobs:
- cd ..

- os: linux
env: TARGET=wii
env: TARGET=wii EXT=tar.bz2
before_install:
- export DEVKITPRO=$CACHE/devkitPro
- export DEVKITPPC=${DEVKITPRO}/devkitPPC
Expand Down Expand Up @@ -165,7 +169,7 @@ jobs:
- cd ..

- os: linux
env: TARGET=3ds
env: TARGET=3ds EXT=cia
addons:
apt:
packages:
Expand Down Expand Up @@ -202,7 +206,11 @@ jobs:

- os: linux
language: android
env: TARGET=Android ANDROID_BUILD_TOOLS=28.0.3 NDK_VERSION=r16 TERM=dumb
env: TARGET=Android ANDROID_BUILD_TOOLS=28.0.3 NDK_VERSION=r16 TERM=dumb EXT=apk PIP="sudo pip3"
addons:
apt:
packages:
- python3-pip
android:
components:
- tools
Expand Down Expand Up @@ -254,8 +262,8 @@ jobs:
fi
- os: osx
osx_image: xcode12.2
env: TARGET=iOS
osx_image: xcode12.3
env: TARGET=iOS EXT=ipa
cache: cocoapods
podfile: ios/SDLPal/Podfile
script:
Expand All @@ -268,8 +276,8 @@ jobs:
- cd ../..

- os: osx
osx_image: xcode12.2
env: TARGET=macOS
osx_image: xcode12.3
env: TARGET=macOS EXT=dmg
language: objective-c
script:
- cd macos
Expand All @@ -280,7 +288,7 @@ jobs:

- os: osx
osx_image: xcode9.2
env: TARGET=macOS SDL=1.2.15
env: TARGET=macOS-SDL1 SDL=1.2.15 EXT=dmg PIP=pip3
before_install:
- |
if ! [ -d /Library/Frameworks/SDL.framework ]
Expand All @@ -303,10 +311,12 @@ jobs:
- xcodebuild -project Pal_SDL12.xcodeproj -configuration Release
- hdiutil create -srcfolder build/Release/Pal.app -volname "SDLPal-SDL1" ../deploy/sdlpal-sdl1-macos.dmg
- cd ..
after_success:
- HOMEBREW_NO_AUTO_UPDATE=1 brew install python3

- os: linux
language: node_js
env: TARGET=Emscripten TAG=1.39.8-upstream
env: TARGET=Emscripten TAG=1.39.8-upstream EXT=zip
services:
- docker
before_install:
Expand All @@ -315,6 +325,9 @@ jobs:
script:
- sed -i 's@http://localhost:8080/@https://sdlpal.github.io/demo/@g' emscripten/Makefile
- docker exec -it emscripten emmake make -C emscripten
- cd emscripten
- zip ../deploy/sdlpal-emscripten.zip *.{html,js,wasm,wasm.map,png}
- cd ..

before_deploy:
- |
Expand All @@ -329,22 +342,10 @@ before_deploy:
fi
- CI=$(git show -s --format=%cI)
- DATE=${CI%T*}
- REV=$(git rev-list --count HEAD)
- COMMIT=$(git rev-parse --short HEAD)
- VERSION=v$DATE-g$COMMIT
- set -f
- |
sed -i.bak "
s/@VERSION@/$VERSION/g
s/@DESC@/$(echo -n $TRAVIS_COMMIT_MESSAGE|tr '\r' '\\r'|tr '\n' '\\n'|sed -e 's@[\\"]@\\&@g;s@[/&\$]@\\&@g')/g
s/@RELEASE_DATE@/$(git show -s --format=%cI)/g
s/@VCS_TAG@/$(git describe --tags)/g
s/@AUTHOR@/$(git show -s --format=%an)/g
s/@AUTHOR_DATE@/$(git show -s --format=%ai)/g
s/@CIMMITER@/$(git show -s --format=%cn)/g
s/@BRANCH@/$TRAVIS_BRANCH/g
s/@COMMITID@/$(git show -s --format=%h)/g
" bintray.json
- set +f
- VERSION=v$DATE-r$REV-g$COMMIT
- $PIP install cloudsmith-cli
- git config --global user.email "sdlpal@sdlpal.com"
- git config --global user.name "SDLPAL"

Expand All @@ -368,21 +369,12 @@ deploy:
on:
all_branches: true
tags: true
- provider: bintray
user: $BINTRAY_USER
key: $BINTRAY_KEY
file: bintray.json
skip_cleanup: true
- provider: script
edge: true
script: cloudsmith push raw sdlpal/sdlpal --version $VERSION --name $TARGET --republish deploy/*.$EXT --tags "branch/$TRAVIS_BRANCH"
on:
all_branches: true

after_deploy:
- curl -sS -u "$BINTRAY_USER:$BINTRAY_KEY" -X PATCH "https://api.bintray.com/packages/sdlpal/nightly/$TRAVIS_BRANCH" -H "Content-Type:application/json" -d '{"github_repo":"sdlpal/sdlpal"}'
- curl -sS -u "$BINTRAY_USER:$BINTRAY_KEY" -X POST "https://api.bintray.com/packages/sdlpal/nightly/$TRAVIS_BRANCH/readme" -H "Content-Type:application/json" -d '{"github":{"github_repo":"sdlpal/sdlpal"}}'
- FILE=$(ls deploy)
- sleep 10
- curl -sS -u "$BINTRAY_USER:$BINTRAY_KEY" -X PUT "https://api.bintray.com/file_metadata/sdlpal/nightly/$VERSION/$FILE" -H "Content-Type:application/json" -d '{"list_in_downloads":true}'

notifications:
webhooks:
urls:
Expand Down
43 changes: 0 additions & 43 deletions bintray.json

This file was deleted.

2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SDLPAL
======
[![Travis CI](https://travis-ci.com/sdlpal/sdlpal.svg?branch=master)](https://travis-ci.com/sdlpal/sdlpal)
[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/sdlpal/sdlpal?branch=master&svg=true)](https://ci.appveyor.com/project/palxex/sdlpal-itfml)
[ ![Download](https://api.bintray.com/packages/sdlpal/nightly/master/images/download.svg) ](https://bintray.com/sdlpal/nightly/master/_latestVersion)
[ ![Download](https://api-prd.cloudsmith.io/badges/version/sdlpal/sdlpal/raw/wii/latest/x/?render=true) ](https://cloudsmith.io/~sdlpal/repos/sdlpal/packages/?q=tag%3Abranch/master%20AND%20version%3Alatest)

***SDLPAL*** is an SDL-based open-source cross-platform reimplementation of the classic Chinese RPG game *Xiān jiàn Qí Xiá Zhuàn (Simplified Chinese: 仙剑奇侠传, Traditional Chinese: 仙劍奇俠傳)* (also known as *Chinese Paladin* or *Legend of Sword and Fairy*, or *PAL* for short).

Expand Down

0 comments on commit 9244437

Please sign in to comment.