Skip to content

Instantly share code, notes, and snippets.

@nerdCopter
Last active June 23, 2020 20:29
Show Gist options
  • Save nerdCopter/f0a503c49ff79bc84e75d2af7b7cfac8 to your computer and use it in GitHub Desktop.
Save nerdCopter/f0a503c49ff79bc84e75d2af7b7cfac8 to your computer and use it in GitHub Desktop.
jfrog-cli for uploading via github actions
[...]
# Upload to Bintray
- name: Upload to Bintray
if: startsWith(github.ref, 'refs/tags/')
run: |
curl -fL https://getcli.jfrog.io | sh
export JFROG_CLI_OFFER_CONFIG=false
export CI=true
export JFROG_CLI_LOG_LEVEL=DEBUG
./jfrog bt config --user=${{secrets.BINTRAYUSERNAME}} --key=${{secrets.BINTRAYAPIKEY}} --licenses=GPL-3.0
export repo="emuflight-dev/dev_hex"
export package="${{steps.get_revtag.outputs.REVISION_TAG}}"
export version="${{github.run_number}}-${{steps.get_version.outputs.VERSION}}-${{steps.get_revtag.outputs.REVISION_TAG}}"
./jfrog bt package-create --pub-dn=true --vcs-url="https://github.com/emuflight" "${repo}/${package}" || true
./jfrog bt version-create "${repo}/${package}/${version}" || true
./jfrog bt upload --publish=true "obj/*.hex" "${repo}/${package}/${version}" "GitHub_Build_${version}/" || true
continue-on-error: true
[...]
@nerdCopter
Copy link
Author

why the || true ?

  • because if the package exists, the build will fail, so ignore the errorlevel
  • because if the version exists, the build will fail, so ignore the errorlevel
  • because if the upload file exists, the build will fail, so ignore the errorlevel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment