Skip to content

SSCSCI-1185

SSCSCI-1185 #4188

name: JitPack Snapshot & Commit Build
on:
pull_request:
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Get the commits repo, branch and hash
id: get_versions
run: |
echo 'Get the commits repo, branch and hash'
echo "repo=${{github.repository}}" >> $GITHUB_OUTPUT
echo "branch=${{github.event.pull_request.head.ref}}" >> $GITHUB_OUTPUT
sha="${{github.event.pull_request.head.sha}}"
echo "sha_short=${sha::7}" >> $GITHUB_OUTPUT
- name: Request release from JitPack to trigger branch build
run: |
echo 'Requesting release from JitPack to trigger commit build for branch: "${{env.target_branch}}"'
echo 'version tag: "${{env.target_version}}"'
jitpack_url="https://jitpack.io/com/github/${{env.target_repo}}/${{env.target_version}}/"
echo 'Jitpack URL: ${jitpack_url}'
# timeout in 30 seconds to avoid waiting for build
curl -s -m 30 ${jitpack_url} || true
echo 'See progress https://jitpack.io/#${{env.target_repo}}'
env:
target_branch: '${{steps.get_versions.outputs.branch}}'
target_version: '${{steps.get_versions.outputs.branch}}-SNAPSHOT'
target_repo: '${{steps.get_versions.outputs.repo}}'
- name: Request release from JitPack to trigger commit build
run: |
echo 'Requesting release from JitPack to trigger commit build for SHA Short: "${{env.target_sha_short}}"'
echo 'version tag "${{env.target_version}}"'
jitpack_url="https://jitpack.io/com/github/${{env.target_repo}}/${{env.target_version}}/"
echo 'Jitpack URL: ${jitpack_url}'
# timeout in 30 seconds to avoid waiting for build
curl -s -m 30 ${jitpack_url} || true
echo 'See progress https://jitpack.io/#${{env.target_repo}}'
env:
target_sha_short: '${{steps.get_versions.outputs.sha_short}}")'
target_version: '${{steps.get_versions.outputs.sha_short}}'
target_repo: '${{steps.get_versions.outputs.repo}}'