Skip to content

In deploy_unified_header.yml, only commit and push if the generated file #11

In deploy_unified_header.yml, only commit and push if the generated file

In deploy_unified_header.yml, only commit and push if the generated file #11

name: Build and deploy a unified header to the single_header branch.
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup
run: |
mkdir ${{github.workspace}}/pcpp
pip install -t ${{github.workspace}}/pcpp pcpp
- name: Build
continue-on-error: true
run: PYTHONPATH=${{github.workspace}}/pcpp:$PYTHONPATH python3 ${{github.workspace}}/pcpp/bin/pcpp -I ${{github.workspace}}/include --passthru-defines --passthru-comments --line-directive -o ${{github.workspace}}/onebig.hpp ${{github.workspace}}/include/boost/parser/parser.hpp ${{github.workspace}}/include/boost/parser/transcode_view.hpp
- name: Deploy
working-directory: ${{github.workspace}}
run: |
git fetch
git switch single_header
mv ${{github.workspace}}/onebig.hpp ${{github.workspace}}/include/boost/parser/parser_unified.hpp
if [ -z `git diff` ] ; then
git config user.name 'Zach Laine'
git config user.email 'whatwasthataddress@gmail.com'
git commit -am 'Generated by Github action on push to master.'
git push
fi