From 3b9e0c4c89e80f6cf8edec03b31cbc0bc98b6b3b Mon Sep 17 00:00:00 2001 From: Sebastian Urchs Date: Thu, 14 Dec 2023 22:30:56 -0500 Subject: [PATCH 1/7] Create release.yaml --- template_workflows/release.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 template_workflows/release.yaml diff --git a/template_workflows/release.yaml b/template_workflows/release.yaml new file mode 100644 index 0000000..3b743cb --- /dev/null +++ b/template_workflows/release.yaml @@ -0,0 +1,27 @@ +name: auto release + +on: + push: + branches: + - main + +jobs: + auto-release: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Download latest auto + run: | + auto_download_url="$(curl -fsSL https://api.github.com/repos/intuit/auto/releases/latest | jq -r '.assets[] | select(.name == "auto-linux.gz") | .browser_download_url')" + wget -O- "$auto_download_url" | gunzip > ~/auto + chmod a+x ~/auto + + - name: Release + run: ~/auto shipit -vv + env: + GH_TOKEN: ${{ secrets.NB_PAT_RELEASE }} From 97b300a189f7e84260809c0bd5d86b3b5871e710 Mon Sep 17 00:00:00 2001 From: Alyssa Dai Date: Sun, 14 Jan 2024 22:15:52 -0500 Subject: [PATCH 2/7] create new sync group for auto-release files and add .autorc --- .github/sync.yml | 57 +++++---- template_configs/.autorc | 110 ++++++++++++++++++ .../{ => auto_release}/release.yaml | 0 3 files changed, 144 insertions(+), 23 deletions(-) create mode 100644 template_configs/.autorc rename template_workflows/{ => auto_release}/release.yaml (100%) diff --git a/.github/sync.yml b/.github/sync.yml index 456d4cd..36869ab 100644 --- a/.github/sync.yml +++ b/.github/sync.yml @@ -1,24 +1,35 @@ group: - repos: | - neurobagel/annotation_tool - neurobagel/api - neurobagel/bagel-cli - neurobagel/bagelschema - neurobagel/bulk_annotations - neurobagel/browbids - neurobagel/digest - neurobagel/documentation - neurobagel/neurobagel_examples - neurobagel/federation-api - neurobagel/menu - neurobagel/openneuro-annotations - neurobagel/planning - neurobagel/proc_dash - neurobagel/project - neurobagel/project - neurobagel/query-tool - neurobagel/recipes - neurobagel/workflows - files: - - source: template_workflows/ - dest: .github/workflows/ + # Workflows related to project organization + - files: + - source: template_workflows/project_automation/ + dest: .github/workflows/ + repos: | + neurobagel/annotation_tool + neurobagel/api + neurobagel/bagel-cli + neurobagel/bagelschema + neurobagel/bulk_annotations + neurobagel/browbids + neurobagel/digest + neurobagel/documentation + neurobagel/neurobagel_examples + neurobagel/federation-api + neurobagel/menu + neurobagel/openneuro-annotations + neurobagel/planning + neurobagel/project + neurobagel/query-tool + neurobagel/recipes + neurobagel/workflows + + # Workflow and configuration files for auto-releasing with intuit/auto + - files: + - source: template_workflows/auto_release/ + dest: .github/workflows/ + - source: template_configs/.autorc + dest: .autorc + # TODO: add JS repos once React migration is complete? + repos: | + neurobagel/api + neurobagel/bagel-cli + neurobagel/federation-api diff --git a/template_configs/.autorc b/template_configs/.autorc new file mode 100644 index 0000000..83f4b1e --- /dev/null +++ b/template_configs/.autorc @@ -0,0 +1,110 @@ +{ + "onlyPublishWithReleaseLabel": true, + "noDefaultLabels": true, + "baseBranch": "main", + "author": "Chef Bot ", + "noVersionPrefix": false, + "plugins": [ + "git-tag", + "released", + "protected-branch", + "first-time-contributor" + ], + "labels": [ + { + "name": "pr-major-breaking", + "changelogTitle": "๐Ÿ’ฅ Breaking Changes", + "description": "Significant behaviour change that breaks compatibility, will increment major version (+1.0.0)", + "releaseType": "major", + "overwrite": true, + "color": "#C5000B" + }, + { + "name": "pr-minor-breaking", + "changelogTitle": "๐Ÿ’ฅ Breaking Changes", + "description": "Feature or enhancement that breaks compatibility, will increment minor version (0.+1.0)", + "releaseType": "minor", + "overwrite": true, + "color": "#F1A60E" + }, + { + "name": "pr-minor", + "changelogTitle": "๐Ÿš€ Enhancements", + "description": "Non-breaking feature or enhancement, will increment minor version (0.+1.0)", + "releaseType": "minor", + "overwrite": true, + "color": "#F1A60E" + }, + { + "name": "pr-patch", + "changelogTitle": "๐Ÿš€ Enhancements", + "description": "Incremental feature improvement, will increment patch version when merged (0.0.+1)", + "releaseType": "patch", + "overwrite": true, + "default": true, + "color": "#870048" + }, + { + "name": "pr-bug-fix", + "changelogTitle": "๐Ÿ› Bug Fixes", + "description": "Bug fix, will increment patch version when merged (0.0.+1)", + "releaseType": "patch", + "overwrite": true, + "color": "#870048" + }, + { + "name": "pr-internal", + "changelogTitle": "๐Ÿ  Internal", + "description": "Non-user-facing code improvement, will increment patch version when merged (0.0.+1)", + "releaseType": "patch", + "overwrite": true, + "color": "#696969" + }, + { + "name": "pr-performance", + "changelogTitle": "๐ŸŽ Performance Improvements", + "description": "Improve performance of an existing feature, will increment patch version when merged (0.0.+1)", + "releaseType": "patch", + "overwrite": true, + "color": "#f4b2d8" + }, + { + "name": "pr-documentation", + "changelogTitle": "๐Ÿ“ Documentation", + "description": "Change that only affects user documentation", + "releaseType": "none", + "overwrite": true, + "color": "#cfd3d7" + }, + { + "name": "pr-tests", + "changelogTitle": " ๐Ÿงช Tests", + "description": "Add or improve existing tests", + "releaseType": "none", + "overwrite": true, + "color": "#ffd3cc" + }, + { + "name": "pr-dependencies", + "changelogTitle": "๐Ÿ”ฉ Dependency Updates", + "description": "Update one or more dependencies version", + "releaseType": "none", + "overwrite": true, + "color": "#8732bc" + }, + { + "name": "skip-release", + "description": "PR doesn't appear in the changelog and preserves current version when merged", + "releaseType": "skip", + "overwrite": true, + "color": "#bf5416" + }, + { + "name": "release", + "description": "Create a release when this PR is merged", + "releaseType": "release", + "overwrite": true, + "color": "#007f70" + } + ] +} diff --git a/template_workflows/release.yaml b/template_workflows/auto_release/release.yaml similarity index 100% rename from template_workflows/release.yaml rename to template_workflows/auto_release/release.yaml From 718748d8422ea2fd85a96e61c97da0dae0310aae Mon Sep 17 00:00:00 2001 From: Alyssa Dai Date: Sun, 14 Jan 2024 22:16:56 -0500 Subject: [PATCH 3/7] create subdirectory for project automation workflows --- .github/sync.yml | 2 +- template_workflows/{ => project_automation}/add_iss2project.yml | 0 template_workflows/{ => project_automation}/stale.yml | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename template_workflows/{ => project_automation}/add_iss2project.yml (100%) rename template_workflows/{ => project_automation}/stale.yml (100%) diff --git a/.github/sync.yml b/.github/sync.yml index 36869ab..993f1e0 100644 --- a/.github/sync.yml +++ b/.github/sync.yml @@ -1,5 +1,5 @@ group: - # Workflows related to project organization + # Workflows related to project automation - files: - source: template_workflows/project_automation/ dest: .github/workflows/ diff --git a/template_workflows/add_iss2project.yml b/template_workflows/project_automation/add_iss2project.yml similarity index 100% rename from template_workflows/add_iss2project.yml rename to template_workflows/project_automation/add_iss2project.yml diff --git a/template_workflows/stale.yml b/template_workflows/project_automation/stale.yml similarity index 100% rename from template_workflows/stale.yml rename to template_workflows/project_automation/stale.yml From 64c420579ec00843ee997517fb5445adbd4803a5 Mon Sep 17 00:00:00 2001 From: Alyssa Dai Date: Sun, 14 Jan 2024 22:17:31 -0500 Subject: [PATCH 4/7] update README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8581164..dbfdbdb 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ This repo helps automatically synchronize shared workflows across repos. -`/template_workflows/` contains inert templates for workflows we want in multiple repos - these templates are not doing anything on their own. +`template_workflows/` and `template_configs/` contain inert templates for files we want in multiple repos - these templates are not doing anything on their own. `.github/sync.yml` is a config file (containing repo names) which is read by `.github/workflows/sync_wf.yml`. -`.github/workflows/sync_wf.yml` is the actual unique active workflow in this repo which takes everything in `/template_workflows/` and makes PRs to add them to each repo listed in the config file. +`.github/workflows/sync_wf.yml` is the actual unique active workflow in this repo which takes the files in the template directories and makes PRs to adds them to appropriate repos listed in the config file. From d6734acca91446fdd562c0c8481ee9006aeacaca Mon Sep 17 00:00:00 2001 From: Alyssa Dai Date: Sun, 14 Jan 2024 22:39:47 -0500 Subject: [PATCH 5/7] update release.yaml to work with branch protection --- template_workflows/auto_release/release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/template_workflows/auto_release/release.yaml b/template_workflows/auto_release/release.yaml index 3b743cb..19195fd 100644 --- a/template_workflows/auto_release/release.yaml +++ b/template_workflows/auto_release/release.yaml @@ -25,3 +25,4 @@ jobs: run: ~/auto shipit -vv env: GH_TOKEN: ${{ secrets.NB_PAT_RELEASE }} + PROTECTED_BRANCH_REVIEWER_TOKEN: ${{ secrets.NB_PAT_RELEASE_PROTECTED }} From 32898e08feae335a158e4bb516a268c18851bbfc Mon Sep 17 00:00:00 2001 From: Alyssa Dai Date: Mon, 15 Jan 2024 02:18:36 -0500 Subject: [PATCH 6/7] add PR template with checkbox for release label --- .github/sync.yml | 2 ++ template_prs/auto_release_repo_pr.md | 41 ++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 template_prs/auto_release_repo_pr.md diff --git a/.github/sync.yml b/.github/sync.yml index 993f1e0..c8db840 100644 --- a/.github/sync.yml +++ b/.github/sync.yml @@ -28,6 +28,8 @@ group: dest: .github/workflows/ - source: template_configs/.autorc dest: .autorc + - source: template_prs/auto_release_repo_pr.md + dest: .github/pull_request_template.md # TODO: add JS repos once React migration is complete? repos: | neurobagel/api diff --git a/template_prs/auto_release_repo_pr.md b/template_prs/auto_release_repo_pr.md new file mode 100644 index 0000000..39ee002 --- /dev/null +++ b/template_prs/auto_release_repo_pr.md @@ -0,0 +1,41 @@ + + + + + + +- Closes # + + +Changes proposed in this pull request: + +- +- + + +## Checklist + +- [ ] PR has an interpretable title with a prefix (`[ENH]`, `[FIX]`, `[REF]`, `[TST]`, `[CI]`, `[MNT]`, `[INF]`, `[MODEL]`, `[DOC]`) _(see https://neurobagel.org/contributing/pull_requests for more info)_ +- [ ] PR has a label for the release changelog or `skip-release` (to be applied by maintainers only) +- [ ] PR links to GitHub issue with mention `Closes #XXXX` +- [ ] Tests pass +- [ ] Checks pass + +For new features: +- [ ] Tests have been added + +For bug fixes: +- [ ] There is at least one test that would fail under the original bug conditions. \ No newline at end of file From 4b6aac0aaf6bc0e1190f3f4f91fd357eab360743 Mon Sep 17 00:00:00 2001 From: Alyssa Dai Date: Mon, 15 Jan 2024 17:14:16 -0500 Subject: [PATCH 7/7] omit bot commits from changelog --- template_configs/.autorc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/template_configs/.autorc b/template_configs/.autorc index 83f4b1e..377746f 100644 --- a/template_configs/.autorc +++ b/template_configs/.autorc @@ -8,7 +8,13 @@ "git-tag", "released", "protected-branch", - "first-time-contributor" + "first-time-contributor", + "omit-commits", + { + "username": "dependabot[bot]", + "subject": "[pre-commit.ci]", + "labels": "_bot" + } ], "labels": [ {