Update branches with updated submodule on libjxl #934
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) the JPEG XL Project Authors. All rights reserved. | |
# | |
# Use of this source code is governed by a BSD-style | |
# license that can be found in the LICENSE file. | |
# Workflow for building and running tests. | |
name: Update branches with updated submodule on libjxl | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '37 2 * * *' # Daily on 02:37 UTC | |
permissions: | |
contents: read | |
jobs: | |
update: | |
if: github.repository_owner == 'libjxl' | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- branch: 'test_highway' | |
tag: 'origin/master' | |
- branch: 'test_highway_1.0.7' | |
tag: '1.0.7' | |
- branch: 'test_highway_1.1.0' | |
tag: '1.1.0' | |
- branch: 'test_highway_1.2.0' | |
tag: '1.2.0' | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 | |
with: | |
egress-policy: audit | |
- name: 'Cloning libjxl' | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
submodules: recursive | |
persist-credentials: false # otherwise, the wrong authentication is used in the push | |
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | |
- name: Pull & update highway | |
working-directory: ./third_party/highway | |
run: | | |
git fetch origin | |
git checkout ${{ matrix.tag }} | |
- name: Update deps.sh | |
run: | | |
NEWHASH=`git -C third_party/highway rev-parse HEAD` | |
sed -i "s/\(THIRD_PARTY_HIGHWAY=\"\)[^\"]*/\1$NEWHASH/" deps.sh | |
- name: Commit | |
run: | | |
git config user.email "firsching@google.com" | |
git config user.name "GitHub Actions - update submodules" | |
git add --all | |
git commit -m "Update highway submodule" || echo "No changes to commit" | |
- name: Push changes | |
uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # v0.8.0 | |
with: | |
github_token: ${{ secrets.TOKEN }} | |
branch: 'refs/heads/${{ matrix.branch }}' | |
force: true |