Skip to content

Commit

Permalink
resolves asciidoctor#1050 fix upstream build to build against the spe…
Browse files Browse the repository at this point in the history
…cified ref
  • Loading branch information
mojavelinux committed Aug 3, 2021
1 parent 850f723 commit ae9cf42
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/upstream-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
ref: ${{ github.event.client_payload.branch }}
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '8'
- name: Build
run: |
unset GEM_PATH GEM_HOME JRUBY_OPTS
./test-asciidoctor-upstream.sh
./test-asciidoctor-upstream.sh ${{ github.event.client_payload.branch }}
19 changes: 11 additions & 8 deletions test-asciidoctor-upstream.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#!/bin/bash
# This script runs the AsciidoctorJ tests against the specified tag (or master) of the Asciidoctor Ruby gem.
# This script runs the AsciidoctorJ tests against the specified ref of the Asciidoctor Ruby gem.

GRADLE_CMD=./gradlew
# to build against a tag, set TAG to a git tag name (e.g., v1.5.2)
TAG=master
if [ "$TAG" == "master" ]; then
SRC_DIR=asciidoctor-master
else
SRC_DIR=asciidoctor-${TAG#v}
# to build against a tag, set REF to a git tag name (e.g., refs/tags/v1.5.2)
REF=refs/heads/master
if [ ! -z "$1" ]; then
REF=$1
if [[ $REF != refs/* ]]; then
REF=refs/heads/$REF
fi
fi
BASE_REF=${REF##*/}
SRC_DIR=asciidoctor-${BASE_REF#v}
rm -rf build/maven && mkdir -p build/maven && cd build/maven
wget --quiet -O $SRC_DIR.zip https://github.com/asciidoctor/asciidoctor/archive/$TAG.zip
wget --quiet -O $SRC_DIR.zip https://github.com/asciidoctor/asciidoctor/archive/$REF.zip
unzip -q $SRC_DIR.zip
cp ../../asciidoctor-gem-installer.pom $SRC_DIR/pom.xml
cd $SRC_DIR
Expand Down

0 comments on commit ae9cf42

Please sign in to comment.