Update Manifests #309
This file contains 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
# If you make any fixes or improvements to this file, please upstream the changes back to: | |
# https://github.com/julia-actions/manifest-updater-examples | |
# Specifically, this file: | |
# https://github.com/julia-actions/manifest-updater-examples/blob/main/.github/workflows/single_pr.yml | |
name: Update Manifests | |
on: | |
schedule: | |
- cron: 0 0 * * 1 | |
workflow_dispatch: | |
permissions: | |
contents: read | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
update_each_manifest: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
# Keep this list in sync with `registry-consistency-ci-cron.yml`. | |
- '1.3' | |
- '1.4' | |
- '1.5' | |
- '1.6' | |
- '1.7' | |
- '1.8' | |
- '1.9' | |
- '1.10' | |
- '1.11' | |
# - '1.12' # Uncomment this line once Julia 1.12 is released | |
# - 'nightly' # TODO: uncomment this line | |
steps: | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- uses: julia-actions/setup-julia@9b79636afcfb07ab02c256cede01fe2db6ba808c # v2.6.0 | |
with: | |
version: ${{ matrix.version }} | |
arch: x64 | |
- name: Cache artifacts | |
uses: julia-actions/cache@824243901fb567ccb490b0d0e2483ccecde46834 # v2.0.5 | |
- run: write(ENV["GITHUB_OUTPUT"], "manifest_version=$(VERSION.major).$(VERSION.minor)") | |
shell: julia --color=yes {0} | |
id: manifest_version | |
- run: echo "We will update the manifest at .ci/Manifest.${{ steps.manifest_version.outputs.manifest_version }}.toml" | |
- run: rm -rf .ci/Manifest.toml | |
- run: | | |
if [ -f ".ci/Manifest.${{ steps.manifest_version.outputs.manifest_version }}.toml" ]; then | |
echo "The manifest file exists, so I will update the existing manifest." | |
mv .ci/Manifest.${{ steps.manifest_version.outputs.manifest_version }}.toml .ci/Manifest.toml | |
else | |
echo "The manifest file does not exist, so I will create a new manifest from scratch." | |
fi | |
- run: julia --color=yes -e 'import Pkg; Pkg.Registry.add("General")' | |
env: | |
JULIA_PKG_SERVER: "" | |
- run: julia --color=yes -e 'import Pkg; Pkg.Registry.update()' | |
- run: .ci/instantiate.sh | |
- run: julia --color=yes --project=.ci/ -e 'import Pkg; Pkg.update()' | |
- run: | | |
if Base.VERSION >= v"1.6" | |
file = abspath(".ci", "shorten_manifest_version_master.jl") | |
if ispath(file) | |
include(file) | |
shorten_manifest_version_master(abspath(".ci")) | |
end | |
end | |
shell: julia --color=yes {0} | |
- run: mv .ci/Manifest.toml .ci/Manifest.${{ steps.manifest_version.outputs.manifest_version }}.toml | |
- run: git status | |
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: manifest_file_for_${{ steps.manifest_version.outputs.manifest_version }} | |
path: .ci/Manifest.${{ steps.manifest_version.outputs.manifest_version }}.toml | |
if-no-files-found: error | |
make_single_pr: | |
needs: update_each_manifest | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- run: rm -rf /tmp/manifest_updater | |
- run: mkdir /tmp/manifest_updater | |
- run: chmod 700 /tmp/manifest_updater | |
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
path: /tmp/manifest_updater/download_artifacts | |
- run: mv /tmp/manifest_updater/download_artifacts/manifest_file_for_*/Manifest.*.toml .ci | |
- run: rm -rf /tmp/manifest_updater | |
- run: rm -rf .ci/Manifest.toml | |
- run: chmod 600 .ci/Project.toml | |
- run: chmod 600 .ci/Manifest.*.toml | |
- run: git status | |
- uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5 | |
with: | |
token: ${{ secrets.TAGBOT_TOKEN }} | |
delete-branch: true | |
branch: 'update_manifests/single_pr/all_manifests' | |
commit-message: '🤖 Update one or more manifest files in the `.ci` directory' | |
title: '🤖 Update one or more manifest files in the `.ci` directory' | |
body: '' | |
labels: | | |
CI |