Replace "hub release" with "gh release" in actions #92
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
name: CI | |
on: [push, pull_request] | |
env: | |
DEVELOPER_DIR: /Applications/Xcode_11.7.app/Contents/Developer | |
jobs: | |
check-ndll-releases: | |
runs-on: ubuntu-20.04 | |
outputs: | |
ndll_hash: ${{ steps.get_project_hash.outputs.hash }} | |
released: ${{ steps.check_release.outputs.released }} | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: krdlab/setup-haxe@v1 | |
with: | |
haxe-version: 4.2.1 | |
- id: get_project_hash | |
shell: bash | |
run: | | |
haxelib git filetree-indexer https://github.com/justin-espedal/haxe-filetree-indexer.git --quiet | |
cd project/tools | |
read -ra output <<<"$(haxe project-hash.hxml --interp)" | |
[[ ${output[1]} =~ ^[0-9a-z]{40}$ ]] && echo "::set-output name=hash::${output[1]}" || exit 1 | |
- uses: actions/github-script@v3 | |
id: check_release | |
env: | |
INPUT_NDLL_HASH: ${{ steps.get_project_hash.outputs.hash }} | |
with: | |
script: | | |
const ndllHash = core.getInput('ndll_hash', { required: true }); | |
core.info('NDLL Hash: ' + ndllHash); | |
await github.repos.getReleaseByTag({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
tag: "ndll/"+ndllHash | |
}).then(data => { | |
core.setOutput('released', 'true'); | |
}).catch((e) => { | |
if(e && e.status===404) { | |
core.setOutput('released', 'false'); | |
} else { | |
core.setFailed('get release by tag error: ', e.message); | |
} | |
}); | |
- name: Create Release | |
id: create_release | |
if: steps.check_release.outputs.released == 'false' | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ format('ndll/{0}', steps.get_project_hash.outputs.hash) }} | |
release_name: ${{ format('ndll/{0}', steps.get_project_hash.outputs.hash) }} | |
draft: false | |
prerelease: true | |
android-ndll: | |
needs: check-ndll-releases | |
if: needs.check-ndll-releases.outputs.released == 'false' | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- uses: krdlab/setup-haxe@v1 | |
with: | |
haxe-version: 4.2.1 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: 8 | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev g++-multilib gcc-multilib libasound2-dev libx11-dev libxext-dev libxi-dev libxrandr-dev libxinerama-dev | |
- name: Install Haxe dependencies | |
run: | | |
haxelib install hxcpp --quiet | |
haxelib install format --quiet | |
haxelib git hxp https://github.com/Stencyl/hxp.git --quiet | |
- name: Enable HXCPP compile cache | |
run: | | |
echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV | |
- name: Install Android NDK | |
uses: nttld/setup-ndk@v1 | |
id: setup-ndk | |
with: | |
ndk-version: r15c | |
- name: Rebuild Lime tools | |
run: | | |
haxelib dev lime $GITHUB_WORKSPACE | |
haxelib run lime rebuild tools -nocolor -verbose -nocffi | |
haxelib run lime rebuild linux -64 -release -nocolor -verbose -nocffi | |
- name: Configure Android support | |
run: | | |
haxelib run lime config ANDROID_SDK $ANDROID_HOME | |
haxelib run lime config ANDROID_NDK_ROOT ${{ steps.setup-ndk.outputs.ndk-path }} | |
haxelib run lime config JAVA_HOME $JAVA_HOME | |
haxelib run lime config ANDROID_SETUP true | |
haxelib run lime config | |
- name: Rebuild Lime | |
run: | | |
haxelib run lime rebuild android -release -verbose -nocolor | |
- name: Upload Release Assets | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
INPUT_NDLL_HASH: ${{ needs.check-ndll-releases.outputs.ndll_hash }} | |
shell: bash | |
run: | | |
cd ndll | |
find Android -type f -name "*.so" | sed 's/\// /' | while read dir asset; do | |
zip -j $dir-$asset.zip $dir/$asset | |
gh release upload "ndll/${INPUT_NDLL_HASH}" $dir-$asset.zip#$dir/$asset | |
done | |
hashlink-ndll: | |
needs: check-ndll-releases | |
if: needs.check-ndll-releases.outputs.released == 'false' | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, macos-11, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- uses: krdlab/setup-haxe@v1 | |
with: | |
haxe-version: 4.2.1 | |
- name: Install system dependencies (Linux) | |
if: ${{ startsWith(matrix.os, 'ubuntu-') }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev g++-multilib gcc-multilib libasound2-dev libx11-dev libxext-dev libxi-dev libxrandr-dev libxinerama-dev | |
- name: Install Haxe dependencies | |
run: | | |
haxelib install hxcpp --quiet | |
haxelib install format --quiet | |
haxelib git hxp https://github.com/Stencyl/hxp.git --quiet | |
- name: Rebuild Lime tools (Windows) | |
if: ${{ startsWith(matrix.os, 'windows-') }} | |
run: | | |
haxelib dev lime $Env:GITHUB_WORKSPACE | |
haxelib run lime rebuild tools -nocolor -verbose -nocffi | |
- name: Rebuild Lime tools (macOS/Linux) | |
if: ${{ !startsWith(matrix.os, 'windows-') }} | |
run: | | |
haxelib dev lime $GITHUB_WORKSPACE | |
haxelib run lime rebuild tools -nocolor -verbose -nocffi | |
- name: Rebuild Lime | |
shell: bash | |
run: | | |
hl_semver="1.12.0" | |
hl_version="68daa125ad115a1f1d1db65d38e6045858d55013" | |
hl_url_base="http://static.stencyl.com/downloads/runtimes/HaxeFoundation/hashlink" | |
case "$(uname -s)" in | |
CYGWIN*|MINGW32*|MSYS*|MINGW*) hl_platforms=("win32" "win64"); hl_extension="zip" ;; | |
Darwin) hl_platforms=("darwin"); hl_extension="tar.gz" ;; | |
*) hl_platforms=("linux-amd64"); hl_extension="tar.gz" ;; | |
esac | |
for hl_platform in ${hl_platforms[@]}; do | |
hl_artifact="hashlink-$hl_semver-$hl_platform.$hl_extension" | |
if [[ $hl_platform == win* ]]; then | |
hl_arch="${hl_platform#win}" | |
else | |
hl_arch="64" | |
fi | |
curl "$hl_url_base/$hl_version/$hl_artifact" -o "$hl_artifact" | |
case "$hl_extension" in | |
zip) | |
unzip "$hl_artifact" -d "hashlink-$hl_platform" | |
hl_path="$(pwd)/hashlink-$hl_platform/hashlink-${hl_version:0:7}-$hl_platform" ;; | |
tar.gz) | |
mkdir "hashlink-$hl_platform" && tar -xzf "$hl_artifact" -C "hashlink-$hl_platform" | |
hl_path="$(pwd)/hashlink-$hl_platform/hashlink-${hl_version:0:7}-$hl_platform" ;; | |
esac | |
haxelib run lime config HASHLINK_PATH "$hl_path" -nocolor -nocffi | |
haxelib run lime rebuild hl "-$hl_arch" -release -verbose -nocolor -nocffi | |
done | |
- name: Upload Release Assets | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
INPUT_NDLL_HASH: ${{ needs.check-ndll-releases.outputs.ndll_hash }} | |
shell: bash | |
run: | | |
cd ndll | |
find * -type f -name "*.hdll" | sed 's/\// /' | while read dir asset; do | |
case "$(uname -s)" in | |
CYGWIN*|MINGW32*|MSYS*|MINGW*) powershell Compress-Archive $dir/$asset $dir-$asset.zip ;; | |
*) zip -j $dir-$asset.zip $dir/$asset ;; | |
esac | |
gh release upload "ndll/${INPUT_NDLL_HASH}" $dir-$asset.zip#$dir/$asset | |
done | |
ios-ndll: | |
needs: check-ndll-releases | |
if: needs.check-ndll-releases.outputs.released == 'false' | |
runs-on: macos-11 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- uses: krdlab/setup-haxe@v1 | |
with: | |
haxe-version: 4.2.1 | |
- name: Install Haxe dependencies | |
run: | | |
haxelib install hxcpp --quiet | |
haxelib install format --quiet | |
haxelib git hxp https://github.com/Stencyl/hxp.git --quiet | |
- name: Enable HXCPP compile cache | |
run: | | |
echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV | |
- name: Rebuild Lime tools | |
run: | | |
haxelib dev lime $GITHUB_WORKSPACE | |
haxelib run lime rebuild tools -nocolor -verbose -nocffi | |
haxelib run lime rebuild macos -release -64 -nocolor -verbose -nocffi | |
- name: Rebuild Lime | |
run: | | |
haxelib run lime rebuild ios -release -verbose -nocolor | |
- name: Upload Release Assets | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
INPUT_NDLL_HASH: ${{ needs.check-ndll-releases.outputs.ndll_hash }} | |
shell: bash | |
run: | | |
cd ndll | |
find iPhone -type f -name "*.a" | sed 's/\// /' | while read dir asset; do | |
zip -j $dir-$asset.zip $dir/$asset | |
gh release upload "ndll/${INPUT_NDLL_HASH}" $dir-$asset.zip#$dir/$asset | |
done | |
linux-ndll: | |
needs: check-ndll-releases | |
if: needs.check-ndll-releases.outputs.released == 'false' | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- uses: krdlab/setup-haxe@v1 | |
with: | |
haxe-version: 4.2.1 | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev g++-multilib gcc-multilib libasound2-dev libx11-dev libxext-dev libxi-dev libxrandr-dev libxinerama-dev | |
- name: Install Haxe dependencies | |
run: | | |
haxelib install hxcpp --quiet | |
haxelib install format --quiet | |
haxelib git hxp https://github.com/Stencyl/hxp.git --quiet | |
- name: Enable HXCPP compile cache | |
run: | | |
echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV | |
- name: Rebuild Lime tools | |
run: | | |
haxelib dev lime $GITHUB_WORKSPACE | |
haxelib run lime rebuild tools -nocolor -verbose -nocffi | |
- name: Rebuild Lime | |
run: | | |
haxelib run lime rebuild linux -64 -release -verbose -nocolor | |
haxelib run lime rebuild linux -32 -release -verbose -nocolor | |
- name: Upload Release Assets | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
INPUT_NDLL_HASH: ${{ needs.check-ndll-releases.outputs.ndll_hash }} | |
shell: bash | |
run: | | |
cd ndll | |
find Linux* -type f -name "*.ndll" | sed 's/\// /' | while read dir asset; do | |
zip -j $dir-$asset.zip $dir/$asset | |
gh release upload "ndll/${INPUT_NDLL_HASH}" $dir-$asset.zip#$dir/$asset | |
done | |
macos-ndll: | |
needs: check-ndll-releases | |
if: needs.check-ndll-releases.outputs.released == 'false' | |
runs-on: macos-11 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- uses: krdlab/setup-haxe@v1 | |
with: | |
haxe-version: 4.2.1 | |
- name: Install Haxe dependencies | |
run: | | |
haxelib install hxcpp --quiet | |
haxelib install format --quiet | |
haxelib git hxp https://github.com/Stencyl/hxp.git --quiet | |
- name: Enable HXCPP compile cache | |
run: | | |
echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV | |
- name: Rebuild Lime tools | |
run: | | |
haxelib dev lime $GITHUB_WORKSPACE | |
haxelib run lime rebuild tools -nocolor -verbose -nocffi | |
- name: Rebuild Lime | |
run: | | |
haxelib run lime rebuild macos -release -verbose -nocolor | |
- name: Upload Release Assets | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
INPUT_NDLL_HASH: ${{ needs.check-ndll-releases.outputs.ndll_hash }} | |
shell: bash | |
run: | | |
cd ndll | |
find Mac* -type f -name "*.ndll" | sed 's/\// /' | while read dir asset; do | |
zip -j $dir-$asset.zip $dir/$asset | |
gh release upload "ndll/${INPUT_NDLL_HASH}" $dir-$asset.zip#$dir/$asset | |
done | |
windows-ndll: | |
needs: check-ndll-releases | |
if: needs.check-ndll-releases.outputs.released == 'false' | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- uses: krdlab/setup-haxe@v1 | |
with: | |
haxe-version: 4.2.1 | |
- name: Install Haxe dependencies | |
run: | | |
haxelib install hxcpp --quiet | |
haxelib install format --quiet | |
haxelib git hxp https://github.com/Stencyl/hxp.git --quiet | |
- name: Enable HXCPP compile cache | |
run: | | |
echo "HXCPP_COMPILE_CACHE=C:\.hxcpp" >> $GITHUB_ENV | |
- name: Rebuild Lime tools | |
run: | | |
haxelib dev lime $Env:GITHUB_WORKSPACE | |
haxelib run lime rebuild tools -nocolor -verbose -nocffi | |
- name: Rebuild Lime | |
run: | | |
haxelib run lime rebuild windows -32 -release -verbose -nocolor | |
haxelib run lime rebuild windows -64 -release -verbose -nocolor | |
- name: Upload Release Assets | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
INPUT_NDLL_HASH: ${{ needs.check-ndll-releases.outputs.ndll_hash }} | |
shell: bash | |
run: | | |
cd ndll | |
find Windows* -type f -name "*.ndll" | sed 's/\// /' | while read dir asset; do | |
powershell Compress-Archive $dir/$asset $dir-$asset.zip | |
gh release upload "ndll/${INPUT_NDLL_HASH}" $dir-$asset.zip#$dir/$asset | |
done |