Skip to content

Make access to special files implementation defined #18

Make access to special files implementation defined

Make access to special files implementation defined #18

Workflow file for this run

name: build-pr
on:
pull_request_target:
types: [assigned, opened, edited, synchronize, reopened]
branches:
- master
jobs:
check_branch:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.check_step.outputs.branch }}
reponame: ${{ steps.check_step.outputs.reponame }}
tag: ${{ steps.check_step.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get branch name, etc.
id: check_step
run: |
raw=${{ github.repository }}
reponame=${raw##*/}
echo "reponame=$reponame" >> $GITHUB_STATE
raw=$(git branch -r --contains ${{ github.ref }})
branch=${raw##*/}
echo "branch=$branch" >> $GITHUB_STATE
tag=""
echo "tag=$tag" >> $GITHUB_STATE
build-and-deploy-pr:
runs-on: ubuntu-latest
needs: check_branch
env:
HAVE_ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN != '' }}
DIFFURI: ${{ secrets.DIFFURI }}
DIFFPW: ${{ secrets.DIFFPW }}
CIWORKFLOW: yes
CI_SHA1: ${{ github.sha }}
CI_BUILD_NUM: ${{ github.run_number }}
CI_PROJECT_USERNAME: ${{ github.repository_owner }}
CI_PROJECT_REPONAME: ${{ needs.check_branch.outputs.reponame }}
CI_BRANCH: ${{ needs.check_branch.outputs.branch }}
CI_TAG: ${{ needs.check_branch.outputs.tag }}
PR_NUMBER: ${{ github.event.number }}
steps:
# We don’t have to preserve anything here because a PR
# should always replace what it previously published
# (if it previously published anything)
- name: Checkout the pull request
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Save the XML
run: |
mkdir /tmp/pr-sources
for f in src step-* steps; do
mkdir /tmp/pr-sources/$f
rsync -ar $f/ /tmp/pr-sources/$f/
done
- name: Checkout the repository base
uses: actions/checkout@v4
- name: Update the XML
run: rsync -var /tmp/pr-sources/ ./
- name: Setup DeltaXML
run: |
echo Setup DeltaXML
if [[ -z "${DIFFURI}" ]]; then
echo "DeltaXML unavailable"
else
curl -s $DIFFURI | openssl enc -aes-256-cbc -salt -pbkdf2 -d -k $DIFFPW | tar zxf -
fi
- name: Build specifications
run: |
./gradlew
- name: Cleanup DeltaXML
run: rm -rf deltaxml
- name: Publish the PR
if: ${{ env.HAVE_ACCESS_TOKEN == 'true' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build/dist
token: ${{ secrets.ACCESS_TOKEN }}
repository-name: ${{ github.repository_owner}}/3.0-specification
branch: gh-pages
target-folder: /pr/${{ github.event.number }}