|
| 1 | +name: ManifestUpdater |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '0 0 * * 1' |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + ManifestUpdater: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v2 |
| 13 | + - name: Get Julia compatibility |
| 14 | + id: julia_compat |
| 15 | + # NOTE: this requires a Julia compat lower-bound with minor version! |
| 16 | + run : | |
| 17 | + version=$(grep '^julia = ' Project.toml | grep -o '".*"' | cut -d '"' -f2) |
| 18 | + echo "::set-output name=version::$version" |
| 19 | + - uses: julia-actions/setup-julia@v1 |
| 20 | + with: |
| 21 | + version: ${{ steps.julia_compat.outputs.version }} |
| 22 | + - name: Update packages |
| 23 | + id: pkg_update |
| 24 | + run: | |
| 25 | + log=$(julia --project -e 'using Pkg; Pkg.update()') |
| 26 | + log="${log//'%'/'%25'}" |
| 27 | + log="${log//$'\n'/'%0A'}" |
| 28 | + log="${log//$'\r'/'%0D'}" |
| 29 | + echo "::set-output name=log::$log" |
| 30 | + - name: Get status |
| 31 | + id: pkg_status |
| 32 | + run: | |
| 33 | + log=$(julia --project -e 'using Pkg; VERSION >= v"1.3" ? Pkg.status(diff=true) : Pkg.status()') |
| 34 | + log="${log//'%'/'%25'}" |
| 35 | + log="${log//$'\n'/'%0A'}" |
| 36 | + log="${log//$'\r'/'%0D'}" |
| 37 | + echo "::set-output name=log::$log" |
| 38 | + - name: Get Julia version |
| 39 | + id: version |
| 40 | + run: | |
| 41 | + log=$(julia -e "println(Base.VERSION)") |
| 42 | + echo "::set-output name=log::$log" |
| 43 | + - name: Create pull request |
| 44 | + uses: peter-evans/create-pull-request@v3 |
| 45 | + with: |
| 46 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 47 | + commit-message: | |
| 48 | + Update dependencies. |
| 49 | +
|
| 50 | + ${{ steps.pkg_status.outputs.log }} |
| 51 | + title: Update manifest |
| 52 | + reviewers: maleadt |
| 53 | + body: | |
| 54 | + This pull request updates the manifest for Julia v${{ steps.version.outputs.log }}: |
| 55 | +
|
| 56 | + ``` |
| 57 | + ${{ steps.pkg_status.outputs.log }} |
| 58 | + ``` |
| 59 | +
|
| 60 | + <details><summary>Click here for the full update log.</summary> |
| 61 | + <p> |
| 62 | +
|
| 63 | + ``` |
| 64 | + ${{ steps.pkg_update.outputs.log }} |
| 65 | + ``` |
| 66 | +
|
| 67 | + </p> |
| 68 | + </details> |
| 69 | + branch: update_manifest |
| 70 | + |
0 commit comments