Skip to content

Commit

Permalink
Automated semantic versioning and release drafter (#801)
Browse files Browse the repository at this point in the history
* test release drafter

* master -> main

* same categories for release-drafter as github release defaults

* add v to version

* version all components with the same calver and release all every time to imply they were tested together

* no release draft on PR, only on push to main

* ubuntu-latest

* release drafter for each package

* add dependencies as reasonable label

* require reasonable label

* rename checker

* latest package only for core

* small typos

* small fixes to configs

* remove contributors list as it already shows up in the release

* small change to match original tags in repo

* explicit read permissions for PRs
  • Loading branch information
zulissimeta authored Aug 13, 2024
1 parent 917056a commit cc3c555
Show file tree
Hide file tree
Showing 11 changed files with 305 additions and 2 deletions.
40 changes: 40 additions & 0 deletions .github/release-drafter-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
include-paths:
- packages/fairchem-core/
- src/fairchem/core/
tag-prefix: fairchem_core
tag-template: 'fairchem_core-$RESOLVED_VERSION'
name-template: 'fairchem-core-$RESOLVED_VERSION'
exclude-contributors: [github-actions]
categories:
- title: New Features
labels: [enhancement]
- title: Bug Fixes
labels: [bug]
- title: 🛠 Enhancements
labels: [enhancement]
- title: Documentation
labels: [documentation]
- title: Tests
labels: [test]
- title: Deprecations
labels: [deprecation]
- title: Dependencies
labels: [dependencies]
- title: Other Changes
labels: ["*"]
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
- 'dependencies'
patch:
labels:
- 'patch'
default: patch
template: |
## What’s Changed
$CHANGES
40 changes: 40 additions & 0 deletions .github/release-drafter-data_oc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
include-paths:
- src/fairchem/data/oc
- packages/fairchem-data-oc
tag-prefix: fairchem_data_oc
tag-template: 'fairchem_data_oc-$RESOLVED_VERSION'
name-template: 'fairchem_data_oc-$RESOLVED_VERSION'
exclude-contributors: [github-actions]
categories:
- title: New Features
labels: [enhancement]
- title: Bug Fixes
labels: [bug]
- title: 🛠 Enhancements
labels: [enhancement]
- title: Documentation
labels: [documentation]
- title: Tests
labels: [test]
- title: Deprecations
labels: [deprecation]
- title: Dependencies
labels: [dependencies]
- title: Other Changes
labels: ["*"]
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
- 'dependencies'
patch:
labels:
- 'patch'
default: patch
template: |
## What’s Changed
$CHANGES
40 changes: 40 additions & 0 deletions .github/release-drafter-demo_ocpapi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
include-paths:
- src/fairchem/demo/ocpapi
- packages/fairchem-demo-ocpapi
tag-prefix: fairchem_demo_ocpapi
tag-template: 'fairchem_demo_ocpapi-$RESOLVED_VERSION'
name-template: 'fairchem_demo_ocpapi-$RESOLVED_VERSION'
exclude-contributors: [github-actions]
categories:
- title: New Features
labels: [enhancement]
- title: Bug Fixes
labels: [bug]
- title: 🛠 Enhancements
labels: [enhancement]
- title: Documentation
labels: [documentation]
- title: Tests
labels: [test]
- title: Deprecations
labels: [deprecation]
- title: Dependencies
labels: [dependencies]
- title: Other Changes
labels: ["*"]
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
- 'dependencies'
patch:
labels:
- 'patch'
default: patch
template: |
## What’s Changed
$CHANGES
40 changes: 40 additions & 0 deletions .github/release-drafter_applications_cattsunami.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
include-paths:
- src/fairchem/applications/cattsunami
- packages/fairchem-applications-cattsunami/
tag-prefix: fairchem_applications_cattsunami
tag-template: 'fairchem_applications_cattsunami-$RESOLVED_VERSION'
name-template: 'fairchem_applications_cattsunami-$RESOLVED_VERSION'
exclude-contributors: [github-actions]
categories:
- title: New Features
labels: [enhancement]
- title: Bug Fixes
labels: [bug]
- title: 🛠 Enhancements
labels: [enhancement]
- title: Documentation
labels: [documentation]
- title: Tests
labels: [test]
- title: Deprecations
labels: [deprecation]
- title: Dependencies
labels: [dependencies]
- title: Other Changes
labels: ["*"]
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
- 'dependencies'
patch:
labels:
- 'patch'
default: patch
template: |
## What’s Changed
$CHANGES
28 changes: 28 additions & 0 deletions .github/workflows/label_checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: PR label checking (major/minor/patch, enhancement, etc)

on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]

jobs:
check-labels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Labels not added (patch, minor, major, dependencies)
if: >
contains(github.event.pull_request.labels.*.name, 'patch') == false &&
contains(github.event.pull_request.labels.*.name, 'minor') == false &&
contains(github.event.pull_request.labels.*.name, 'major') == false &&
contains(github.event.pull_request.labels.*.name, 'dependencies') == false
run: exit 1
- name: Labels not added (enhancement,bug,test,deprecation,dependencies,documentation,deprecation)
if: >
contains(github.event.pull_request.labels.*.name, 'enhancement') == false &&
contains(github.event.pull_request.labels.*.name, 'bug') == false &&
contains(github.event.pull_request.labels.*.name, 'test') == false &&
contains(github.event.pull_request.labels.*.name, 'deprecation') == false &&
contains(github.event.pull_request.labels.*.name, 'dependencies') == false &&
contains(github.event.pull_request.labels.*.name, 'documentation') == false &&
contains(github.event.pull_request.labels.*.name, 'deprecation') == false
run: exit 1
28 changes: 28 additions & 0 deletions .github/workflows/release-drafter-applications_cattsunami.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release Drafter - fairchem_applications_cattsunami

on:
push:
branches:
- main
paths:
- 'src/fairchem/applications/cattsunami/**'
- 'packages/fairchem-applications-cattsunami/**'
workflow_dispatch:

permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
with:
disable-autolabeler: true
config-name: release-drafter-applications_cattsunami.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/release-drafter-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release Drafter - fairchem_core

on:
push:
branches:
- main
paths:
- 'src/fairchem/core/**'
- 'packages/fairchem-core/**'
workflow_dispatch:

permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
with:
disable-autolabeler: true
latest: true
config-name: release-drafter-core.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/release-drafter-data_oc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release Drafter - fairchem_data_oc

on:
push:
branches:
- main
paths:
- 'src/fairchem/data/oc/**'
- 'packages/fairchem-data-oc/**'
workflow_dispatch:


permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
with:
disable-autolabeler: true
config-name: release-drafter-data_oc.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/release-drafter-demo_ocpapi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release Drafter - fairchem_demo_ocpapi

on:
push:
branches:
- main
paths:
- 'src/fairchem/demo/ocpapi/**'
- 'packages/fairchem-demo-ocpapi/**'
workflow_dispatch:


permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
with:
disable-autolabeler: true
config-name: release-drafter-demo_ocpapi.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

docs:
needs: test
uses: ./.github/workflows/docs.yml
uses: ./.github/workflows/deploy_docs.yml
secrets: inherit

release-core:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

docs:
needs: test
uses: ./.github/workflows/docs.yml
uses: ./.github/workflows/build_docs.yml
secrets: inherit

release-core:
Expand Down

0 comments on commit cc3c555

Please sign in to comment.