diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 5d8c4d1e1..6c9c37de4 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -441,64 +441,3 @@ jobs: - name: Test run: bazelisk test //... --enable_runfiles --incompatible_strict_action_env --test_output=all - - heron: - # Job to verify that the tasks performed by UpdateAlways have been done. It is - # the committer's responsibility (currently) to run UpdateAlways themselves when - # making a PR, so that everything is kept in-sync. - name: Check autogenerated file freshness - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - submodules: false - fetch-depth: 0 # Necessary for maint/UpdateAlways - fetch-tags: false - # Check out the unmerged source branch for `pull_request`-triggered runs; - # otherwise use the tip of the branch for `workflow_dispatch` and `pull` triggers. - ref: ${{ github.event.pull_request.head.ref || github.ref }} - repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} - - - name: UpdateDates - if: | - github.event_name != 'pull_request' && - (startsWith(github.ref, 'refs/heads/release/') || - startsWith(github.ref, 'refs/tags/pcre2-')) - run: maint/UpdateDates.py - - - name: UpdateAlways - run: maint/UpdateAlways - - - name: 'Rebuild *.h.generic' - run: | - ./autogen.sh && ./configure - - # Workaround for incorrect filesystem permissions on /usr/share/aclocal, which - # causes the m4 macros to be copied with incorrect permissions. - # https://github.com/actions/runner-images/issues/11212 - chmod u=rw,go=r m4/*.m4 - - rm -f src/*.generic - make src/config.h.generic src/pcre2.h.generic - - # If we're in a forked repo, it's too onerous to expect contributors to run the - # checks locally to keep these files up to date (since the tool versions are very - # fussy and brittle). - # - # However, we still want to run the steps above, to check that the UpdateAlways - # process is able to run to completion, since it can pick up errors in the man pages. - - - name: Commit and push, if not in a forked repo - if: github.event_name != 'pull_request' || ( ! github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' ) - run: | - if [ -n "`git status --porcelain`" ] ; then - # Dirty working tree: push it - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add -u - git commit -m "Sync autogenerated files #noupdate" - git push - fi diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 2c7ac292b..93520d989 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -2,9 +2,10 @@ name: Deploy Pages on: workflow_dispatch: workflow_run: - workflows: [ 'Sync doc changes' ] + workflows: [ 'Sync' ] types: - completed + branches: [ master ] push: branches: [ pages ] pull_request: diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 000000000..72c48292b --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,102 @@ +name: Sync +on: + workflow_dispatch: + push: + branches: [ master, "release/**" ] + pull_request: + branches: [ master ] + +permissions: + contents: read + +jobs: + sync-autogenerated: + # Job to verify that the tasks performed by UpdateAlways have been done. It is + # the committer's responsibility (currently) to run UpdateAlways themselves when + # making a PR, so that everything is kept in-sync. + name: Check autogenerated file freshness + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + submodules: false + fetch-depth: 0 # Necessary for maint/UpdateAlways + fetch-tags: false + # Check out the unmerged source branch for `pull_request`-triggered runs; + # otherwise use the tip of the branch for `workflow_dispatch` and `pull` triggers. + ref: ${{ github.event.pull_request.head.ref || github.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} + + - name: UpdateDates + if: | + github.event_name != 'pull_request' && + (startsWith(github.ref, 'refs/heads/release/') || + startsWith(github.ref, 'refs/tags/pcre2-')) + run: maint/UpdateDates.py + + - name: UpdateAlways + run: maint/UpdateAlways + + - name: 'Rebuild *.h.generic' + run: | + ./autogen.sh && ./configure + + # Workaround for incorrect filesystem permissions on /usr/share/aclocal, which + # causes the m4 macros to be copied with incorrect permissions. + # https://github.com/actions/runner-images/issues/11212 + chmod u=rw,go=r m4/*.m4 + + rm -f src/*.generic + make src/config.h.generic src/pcre2.h.generic + + # If we're in a forked repo, it's too onerous to expect contributors to run the + # checks locally to keep these files up to date (since the tool versions are very + # fussy and brittle). + # + # However, we still want to run the steps above, to check that the UpdateAlways + # process is able to run to completion, since it can pick up errors in the man pages. + + - name: Commit and push, if not in a forked repo + if: github.event_name != 'pull_request' || ( ! github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' ) + run: | + if [ -n "`git status --porcelain`" ] ; then + # Dirty working tree: push it + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add -u + git commit -m "Sync autogenerated files #noupdate" + git push + fi + + sync-docs: + name: Sync content from master to pages + runs-on: ubuntu-latest + if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master' + needs: ['sync-autogenerated'] + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + submodules: false + fetch-depth: 0 # Necessary to get both the master and pages branches + fetch-tags: false + ref: pages + + - name: Commit and push, if docs have changed + run: | + if ! git diff --exit-code origin/master -- \ + ./doc ./AUTHORS.md ./LICENCE.md ./SECURITY.md ./README.md \ + ./README ./NON-AUTOTOOLS-BUILD >/dev/null ; then + # Differences from master: merge and push + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git merge origin/master --no-edit -m"Sync content from master to pages" + git push + else + echo "No content changes to sync" + fi \ No newline at end of file diff --git a/.github/workflows/syncpages.yml b/.github/workflows/syncpages.yml deleted file mode 100644 index 99f296b17..000000000 --- a/.github/workflows/syncpages.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Sync doc changes -on: - workflow_dispatch: - push: - branches: [ master ] - -permissions: - contents: read - -jobs: - sync-docs: - name: Sync content from master to pages - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - submodules: false - fetch-depth: 0 # Necessary to get both the master and pages branches - fetch-tags: false - ref: pages - - - name: Commit and push, if docs have changed - run: | - if ! git diff origin/master -- ./doc ./AUTHORS.md ./LICENCE.md ./SECURITY.md \ - ./README ./NON-AUTOTOOLS-BUILD >/dev/null ; then - # Differences from master: merge and push - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git merge origin/master --no-edit -m"Sync content from master to pages" - git push - else - echo "No content changes to sync" - fi \ No newline at end of file diff --git a/m4/pcre2_zos.m4 b/m4/pcre2_zos.m4 index b7c094678..2e5dbd48b 100644 --- a/m4/pcre2_zos.m4 +++ b/m4/pcre2_zos.m4 @@ -47,4 +47,4 @@ AC_DEFUN([PCRE2_ZOS_FIXES], fi fi -]) \ No newline at end of file +])