diff --git a/.github/rd-release-config.yml b/.github/rd-release-config.yml new file mode 100644 index 000000000..6f1d103d2 --- /dev/null +++ b/.github/rd-release-config.yml @@ -0,0 +1,177 @@ +filter-by-commitish: False +include-pre-releases: false +categories: + - title: 'Features' + labels: + - 'features' + - title: 'Enhancements' + labels: + - 'performance' + - 'enhancement' + - title: 'Bug Fixes' + labels: + - 'bug' + - title: 'Benchmarking' + label: 'benchmarking' + - title: 'Documentation' + labels: + - 'documentation' + - title: 'Testing' + label: 'testing' + - title: 'Security' + labels: + - 'security' + - title: 'Core' + label: 'core' + - title: 'Classification' + label: 'classification' + - title: 'Cluster' + label: 'cluster' + - title: 'Datasets' + label: 'datasets' + - title: 'Decomposition' + label: 'decomposition' + - title: 'FFT' + label: 'fft' + - title: 'Graph' + label: 'graph' + - title: 'Linear Algebra' + label: 'linalg' + - title: 'Naive Bayes' + label: 'naive bayes' + - title: 'Neural Networks' + labels: + - 'nn' + - 'neural net' + - title: 'Optimization' + label: 'optim' + - title: 'Preprocessing' + label: 'preprocessing' + - title: 'Regression' + label: 'regression' + - title: 'Sparse' + label: 'sparse' + - title: 'Spatial' + label: 'spatial' + - title: 'Utils' + label: 'utils' +exclude-labels: + - 'github-actions' + - 'dependencies' + - 'chore' + - 'workflows' + +autolabeler: + - label: 'workflows' + files: + - '.github/**/*' + title: + - '/Workflow.+/' + - label: 'chore' + title: + - '/\[pre-commit.ci\].+/' + - label: 'features' + title: + - '/feat/i' + - '/feature/i' + - '/implement/i' + - '/add/i' + - '/new/i' + branch: + - '/feature/i' + - '/feat/i' + - label: 'enhancement' + title: + - '/Refactor.+/' + - '/Expand.+/' + - label: 'documentation' + files: + - 'doc/**/*' + - '*.md' + - label: 'benchmarking' + files: + - 'benchmarks/**/*' + - label: 'docker' + files: + - 'docker/**/*' + - label: 'backport release' + title: + - '/bug/i' + - '/resolve/i' + - '/fix/i' + branch: + - '/bug/i' + - '/fix/i' + - label: 'bug' + title: + - '/bug/i' + - '/resolve/i' + - '/fix/i' + branch: + - '/bug/i' + - '/fix/i' + - label: 'interoperability' + title: + - '/Support.+/' + - label: 'testing' + files: + - '**/tests/**/*' + - label: 'classification' + files: + - 'heat/classification/**/*' + - label: 'cluster' + files: + - 'heat/cluster/**/*' + - label: 'core' + files: + - 'heat/core/**/*' + - label: 'datasets' + files: + - 'heat/datasets/**/*' + - label: 'decomposition' + files: + - 'heat/decomposition/**/*' + - label: 'fft' + files: + - 'heat/fft/**/*' + - label: 'graph' + files: + - 'heat/graph/**/*' + - label: 'naive bayes' + files: + - 'heat/naive_bayes/**/*' + - label: 'nn' + files: + - 'heat/nn/**/*' + - label: 'optim' + files: + - 'heat/optim/**/*' + - label: 'preprocessing' + files: + - 'heat/preprocessing/**/*' + - label: 'regression' + files: + - 'heat/regression/**/*' + - label: 'sparse' + files: + - 'heat/sparse/**/*' + - label: 'spatial' + files: + - 'heat/spatial/**/*' + - label: 'utils' + files: + - 'heat/utils/**/*' + - label: 'linalg' + files: + - 'heat/core/linalg/**/*' + +change-template: '- #$NUMBER $TITLE (by @$AUTHOR)' +category-template: '### $TITLE' +template: | + ## Changes + + $CHANGES + + ## Contributors + + $CONTRIBUTORS diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index c92515668..000000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,113 +0,0 @@ -filter-by-commitish: true -categories: - - title: '🔥 Features' - labels: - - 'enhancement' - - title: '🐛 Bug Fixes' - labels: - - 'bug :bug:' - - title: 'Google Summer of Code 2022' - label: 'GSoC22' - - title: '💯 Benchmarking' - label: 'benchmarking' - - title: '📜 Documentation' - label: 'documentation :book:' - - title: ' Testing' - label: 'testing' - - title: 'Arithmetic' - label: 'arithmetic' - - title: 'Array API' - label: 'array API' - - title: 'Classification' - label: 'classification' - - title: 'Cluster' - label: 'cluster' - - title: 'Communication' - labels: - - 'io' - - 'I/O' - - 'communication' - - title: 'Complex Math' - label: 'complex math' - - title: 'Constants' - label: 'constants' - - title: 'Datasets' - label: 'datasets' - - title: 'Devices' - label: 'devices' - - title: 'DNDarray' - label: 'dndarray' - - title: 'Exponential' - label: 'exponential' - - title: 'Factories' - label: 'factories' - - title: 'Graph' - label: 'graph' - - title: 'Indexing' - label: 'indexing' - - title: 'Interoperability' - label: 'interoperability' - - title: 'Linear Algebra' - label: 'linalg' - - title: 'Logical' - label: 'logical' - - title: 'Manipulations' - label: 'manipulation' - - title: 'Memory' - label: 'memory' - - title: 'Naive Bayes' - label: 'naive Bayes' - - title: 'Neural Networks' - labels: - - 'nn' - - 'neural net' - - title: 'Optimization' - label: 'optim' - - title: 'Printing' - label: 'printing' - - title: 'Random' - label: 'random' - - title: 'Regression' - label: 'regression' - - title: 'Relational' - label: 'relational' - - title: 'Rounding' - label: 'rounding' - - title: 'Sanitation' - label: 'sanitation' - - title: 'Signal' - label: 'signal' - - title: 'Sparse' - label: 'sparse' - - title: 'Spatial' - label: 'spatial' - - title: 'Statistics' - label: 'statistics' - - title: 'Stride Tricks' - label: 'stride tricks' - - title: 'Tiling' - label: 'tiling' - - title: 'Trigonometrics' - label: 'trigonometrics' - - title: 'Types' - label: 'types' -exclude-labels: - - 'github-actions' - - 'dependencies' - - 'chore' - - 'workflows' -autolabeler: - - label: 'chore' - title: - - '\[pre-commit.ci\] .*' - -change-template: '- #$NUMBER $TITLE (by @$AUTHOR)' -category-template: '### $TITLE' -template: | - ## Changes - - $CHANGES - - ## Contributors - - $CONTRIBUTORS diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 470ae27fc..f599bb28e 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -2,11 +2,7 @@ name: Release Drafter on: pull_request_target: - types: [closed] - -permissions: - contents: read - + types: [opened, reopened, synchronize] jobs: update_release_draft: permissions: @@ -15,10 +11,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 with: egress-policy: audit - - uses: release-drafter/release-drafter@09c613e259eb8d4e7c81c2cb00618eb5fc4575a7 # v5.25.0 + - uses: release-drafter/release-drafter@v6 # v6.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + commitish: 'release' + name: ${{ github.ref_name }} - Draft release + config-name: rd-release-config.yml diff --git a/.github/workflows/release-prep.yml b/.github/workflows/release-prep.yml new file mode 100644 index 000000000..1e28bae9e --- /dev/null +++ b/.github/workflows/release-prep.yml @@ -0,0 +1,85 @@ +name: Prep Heat Release + +on: + workflow_dispatch: + inputs: + release_version: + description: "The version to release" + required: true + default: "0.0.0" + base_branch: + description: "The base branch to create the release branch from" + required: true + default: "main" + +permissions: + contents: write + pull-requests: write + +jobs: + release: + # environment: release + runs-on: ubuntu-latest + steps: + - name: Harden Runner + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 + with: + egress-policy: audit + + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.base_branch }} + - name: Bump version.py and create PR + env: + PR_BRANCH: pre-release/${{ inputs.release_version }} + VERSION: ${{ inputs.release_version }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Create branch + git checkout -b pre-release/${VERSION} + + # Split version number into major, minor, and micro + MAJOR=$(echo $VERSION | cut -d. -f1) + MINOR=$(echo $VERSION | cut -d. -f2) + MICRO=$(echo $VERSION | cut -d. -f3) + + # Write on to the version.py file + sed -i "s/major: int = \([0-9]\+\)/major: int = $MAJOR/g" heat/core/version.py + sed -i "s/minor: int = \([0-9]\+\)/minor: int = $MINOR/g" heat/core/version.py + sed -i "s/micro: int = \([0-9]\+\)/micro: int = $MICRO/g" heat/core/version.py + sed -i "s/extension: str = .*/extension: str = None/g" heat/core/version.py + + # Git configuration with anonymous user and email + git config --global user.email "" + git config --global user.name "Heat Release Bot" + + # Commit the changes + git add heat/core/version.py + git commit -m "Bump version to $VERSION" + + # Push the changes + git push --set-upstream origin pre-release/${VERSION} + + # Create PR for release + gh pr create \ + --base release \ + --head ${{ env.PR_BRANCH }} \ + --title "Heat ${{ env.VERSION }} - Release" \ + --body "Pre-release branch for Heat ${{ env.VERSION }}. + Any release work should be done on this branch, and then merged into the release branch and main, following git-flow. + + TODO: + - [x] Update version.py + - [ ] update the Requirements section on README.md if needed + - [ ] Update CITATION.cff if needed + - [ ] Ensure the Changelog is up to date + + [1]: https://github.com/peter-evans/create-pull-request" \ + --label invalid + + # Create PR for main + gh pr create --base main \ + --head ${{ env.PR_BRANCH }} \ + --title "Heat ${{ env.VERSION }} - Main" \ + --body "Copy of latest pre-release PR targeting release." \ + --label invalid