Synchronize with upstream repositories #2644
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
| name: Synchronize with upstream repositories | |
| on: | |
| schedule: | |
| - cron: '* 0 * * *' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| env: | |
| ICE_HOME: /opt/ice-3.6.5 # location where Ice is installed | |
| GH_TOKEN: ${{ github.token }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Ice Java and Python binding | |
| uses: ome/action-ice@v3 | |
| - name: Set up configuration | |
| run: | | |
| git config --global user.email github-actions@github.com | |
| git config --global user.name github-actions | |
| - name: Checkout repositories | |
| run: | | |
| cd .. | |
| WORKSPACE=$(pwd) | |
| echo "space="${WORKSPACE} >> $GITHUB_ENV | |
| git clone https://github.com/ome/omeroweb-install | |
| git clone https://github.com/ome/omero-install | |
| - name: Download latest release of OMERO.server | |
| run: | | |
| cd .. | |
| gh release download -R ome/openmicroscopy --pattern "OMERO.server*zip" | |
| unzip OMERO.server*.zip && rm OMERO.server*.zip | |
| ln -s OMERO.server* OMERO.server | |
| - name: Create Virtual environment | |
| run: | | |
| python -m venv $space/.venv3 | |
| $space/.venv3/bin/pip install https://github.com/glencoesoftware/zeroc-ice-py-ubuntu2204-x86_64/releases/download/20221004/zeroc_ice-3.6.5-cp310-cp310-linux_x86_64.whl | |
| - name: Update documentation | |
| run: | | |
| WORKSPACE=$space bash autogen_omero.sh | |
| - name: Find modified files | |
| id: upstream_repo | |
| run: | | |
| files=$(git diff --name-only) | |
| value="Changes from upstream repositories: " | |
| if [[ "openmicroscopy" =~ .*"$file".* ]]; then | |
| value="${value} openmicroscopy" | |
| elif [[ "omero-install" =~ .*"$file".* ]]; then | |
| value="${value} omero-install" | |
| elif [[ "omeroweb-install" =~ .*"$file".* ]]; then | |
| value="${value} omeroweb-install" | |
| fi | |
| echo "value=$value" >> $GITHUB_OUTPUT | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| labels: include | |
| commit-message: ${{ steps.upstream_repo.outputs.value }} | |
| delete-branch: true | |
| title: ${{ steps.upstream_repo.outputs.value }} | |
| body: | | |
| - This PR contains changes from upstream repositories | |
| Auto-generated by [create-pull-request][1] | |
| [1]: https://github.com/peter-evans/create-pull-request |