Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated semantic versioning and release drafter #801

Merged
merged 17 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/release-drafter.yml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file looks like a duplicate for this https://github.com/FAIR-Chem/fairchem/blob/main/.github/release.yml, right?

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
exclude-contributors: [github-actions, dependabot]
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: Other Changes
labels: ["*"]
template: |
## What’s Changed

$CHANGES

$CONTRIBUTORS
35 changes: 35 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main

permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-20.04
steps:
- name: Generate CalVer version
id: calver
run: |
export VERSION=v$(date "+%Y.%m.%d")
echo ::set-output name=version::${VERSION}
echo "Version set to ${VERSION}"
- uses: release-drafter/release-drafter@v6
with:
tag: ${{ steps.calver.outputs.version }}
name: ${{ steps.calver.outputs.version }}
version: ${{ steps.calver.outputs.version }}
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ jobs:

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

release-core:
needs: [ build ]
runs-on: ubuntu-latest
if: |
( github.event.inputs.release-pypi == 'true' && startsWith(github.ref_name, 'fairchem_core-') ) || startsWith(github.event.release.tag_name, 'fairchem_core-')
( github.event.inputs.release-pypi == 'true')

environment:
name: pypi
Expand All @@ -54,7 +54,7 @@ jobs:
needs: [ build ]
runs-on: ubuntu-latest
if: |
( github.event.inputs.release-pypi == 'true' && startsWith(github.ref_name, 'fairchem_data_oc-') ) || startsWith(github.event.release.tag_name, 'fairchem_data_oc-')
( github.event.inputs.release-pypi == 'true')

environment:
name: pypi
Expand All @@ -79,7 +79,7 @@ jobs:
needs: [ build ]
runs-on: ubuntu-latest
if: |
( github.event.inputs.release-pypi == 'true' && startsWith(github.ref_name, 'fairchem_demo_ocpapi-') ) || startsWith(github.event.release.tag_name, 'fairchem_demo_ocpapi-')
( github.event.inputs.release-pypi == 'true')

environment:
name: pypi
Expand All @@ -104,7 +104,7 @@ jobs:
needs: [ build ]
runs-on: ubuntu-latest
if: |
( github.event.inputs.release-pypi == 'true' && startsWith(github.ref_name, 'fairchem_applications_cattsunami-') ) || startsWith(github.event.release.tag_name, 'fairchem_applications_cattsunami-')
( github.event.inputs.release-pypi == 'true')

environment:
name: pypi
Expand Down