diff --git a/cookiecutter.json b/cookiecutter.json index 86e6a43..be877c6 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -5,6 +5,7 @@ "author_name": "", "author_email": "", "project_url": "", + "github_repo": "sunpy/sunpy", "license": [ "BSD 3-Clause", "GNU GPL v3+", @@ -16,7 +17,8 @@ "3.9", "3.10", "3.11", - "3.12" + "3.12", + "3.13" ], "use_compiled_extensions": "n", "enable_dynamic_dev_versions": "n", diff --git a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml index 9a3d4e1..f69e399 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/ci.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/ci.yml @@ -73,23 +73,6 @@ jobs: envs: | - linux: build_docs - cron: - if: | - github.event_name == 'workflow_dispatch' || ( - github.event_name == 'pull_request' && - contains(github.event.pull_request.labels.*.name, 'Run cron CI') - ) - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main - with: - default_python: '{{ default_python }}' - submodules: false - coverage: codecov - toxdeps: tox-pypi-filter - envs: | - - linux: py311-devdeps - secrets: - CODECOV_TOKEN: {{ '${{ secrets.CODECOV_TOKEN }}' }} - publish: # Build wheels on PRs only when labelled. Releases will only be published if tagged ^v.* # see https://github-actions-workflows.openastronomy.org/en/latest/publish.html#upload-to-pypi diff --git a/{{ cookiecutter.package_name }}/.github/workflows/cron.yml b/{{ cookiecutter.package_name }}/.github/workflows/cron.yml new file mode 100644 index 0000000..200073e --- /dev/null +++ b/{{ cookiecutter.package_name }}/.github/workflows/cron.yml @@ -0,0 +1,54 @@ +{% set default_python = '3.12' %} +name: Daily cron + +on: + workflow_dispatch: + schedule: + # ┌───────── minute (0 - 59) + # │ ┌───────── hour (0 - 23) + # │ │ ┌───────── day of the month (1 - 31) + # │ │ │ ┌───────── month (1 - 12 or JAN-DEC) + # │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT) + - cron: '0 3 * * *' # run every day at 3am UTC + pull_request: + # We also want this workflow triggered if the 'Run cron CI' label is added + # or present when PR is updated + types: + - synchronize + - labeled + push: + # We want this workflow to always run on release branches as well as + # all tags since we want to be really sure we don't introduce + # regressions on the release branches, and it's also important to run + # this on pre-release and release tags. + branches: + - 'main' + - '*.*' + - '!*backport*' + tags: + - 'v*' + - '!*dev*' + - '!*pre*' + - '!*post*' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + cron: + # Run on all triggers other than pull_request unless there's a label + if: (github.repository == '{{ cookiecutter.github_repo }}' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Run cron CI'))) + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + with: + default_python: '{{ default_python }}' + submodules: false + coverage: codecov + toxdeps: tox-pypi-filter + envs: | + - linux: py311-devdeps + secrets: + CODECOV_TOKEN: {{ '${{ secrets.CODECOV_TOKEN }}' }} diff --git a/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml b/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml index 0b657f2..314d704 100644 --- a/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml +++ b/{{ cookiecutter.package_name }}/.github/workflows/sub_package_update.yml @@ -18,6 +18,8 @@ on: jobs: update: + # Do not run this workflow on forks + if: github.repository == '{{ cookiecutter.github_repo }}' runs-on: ubuntu-latest strategy: fail-fast: true @@ -86,6 +88,9 @@ jobs: delete-branch: true draft: ${{ steps.cruft_update.outputs.merge_conflicts == '1' }} title: "Updates from the package template" + labels: | + No Changelog Entry Needed + pre-commit.ci run body: | This is an autogenerated PR, which will applies the latest changes from the [SunPy Package Template](https://github.com/sunpy/package-template). If this pull request has been opened as a draft there are conflicts which need fixing.