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