diff --git a/.autorc b/.autorc new file mode 100644 index 00000000..f63bd721 --- /dev/null +++ b/.autorc @@ -0,0 +1,118 @@ +{ + "onlyPublishWithReleaseLabel": true, + "noDefaultLabels": true, + "baseBranch": "main", + "author": "Chef Bot ", + "noVersionPrefix": false, + "plugins": [ + "git-tag", + "released", + "protected-branch", + "first-time-contributor", + [ + "omit-commits", + { + "username": "dependabot[bot]", + "subject": "[pre-commit.ci]", + "labels": "_bot" + } + ] + ], + "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/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..849cb1ae --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,47 @@ + + + + + + +- Closes # + + + +Changes proposed in this pull request: + +- +- + + + +## Checklist + +_This section is for the PR reviewer_ + +- [ ] PR has an interpretable title with a prefix (`[ENH]`, `[FIX]`, `[REF]`, `[TST]`, `[CI]`, `[MNT]`, `[INF]`, `[MODEL]`, `[DOC]`) _(see our [Contributing Guidelines](https://neurobagel.org/contributing/CONTRIBUTING#pull-request-guidelines) 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. diff --git a/.github/workflows/add_iss2project.yml b/.github/workflows/add_iss2project.yml new file mode 100644 index 00000000..30d57fc0 --- /dev/null +++ b/.github/workflows/add_iss2project.yml @@ -0,0 +1,16 @@ +name: Add new issues to project + +on: + issues: + types: + - opened + +jobs: + add-to-project: + name: Add issue to project + runs-on: ubuntu-latest + steps: + - uses: actions/add-to-project@main + with: + project-url: https://github.com/orgs/neurobagel/projects/1 + github-token: ${{ secrets.NB_PROJECT_PAT }} diff --git a/.github/workflows/build_docker_on_release.yml b/.github/workflows/build_docker_on_release.yml new file mode 100644 index 00000000..74cf1df4 --- /dev/null +++ b/.github/workflows/build_docker_on_release.yml @@ -0,0 +1,26 @@ +name: build Docker image on release + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/query_tool:latest, ${{ secrets.DOCKERHUB_USERNAME }}/query_tool:${{ github.event.release.tag_name }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..19195fdc --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,28 @@ +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 }} + PROTECTED_BRANCH_REVIEWER_TOKEN: ${{ secrets.NB_PAT_RELEASE_PROTECTED }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 00000000..4e94a9bc --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,24 @@ +name: 'Close stale issues and PRs' +on: + schedule: + - cron: '30 1 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v8 + with: + stale-issue-message: | + We want to keep our issues up to date and active. This issue hasn't seen any activity in the last 75 days. + We have applied the `_flag:stale` label to indicate that this issue should be reviewed again. + When you review, please reread the spec and then apply one of these three options: + - prioritize: apply the `flag:schedule` label to suggest moving this issue into the backlog now + - close: if the issue is no longer relevant, explain why (give others a chance to reply) and then close. + - archive: sometimes an issue has important information or ideas but we won't work on it soon. In this case + apply the `someday` label to show that this won't be prioritized. The stalebot will ignore issues with this + label in the future. Use sparingly! + days-before-stale: 75 + days-before-close: -1 + stale-issue-label: '_flag:stale' + exempt-issue-labels: 'Roadmap,Milestone,Epic,someday'