diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..9af0b3c --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,21 @@ +# .github/release.yml +# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes + +changelog: + exclude: + labels: + - ignore-for-release + - no-changelog + + authors: + - pre-commit-ci[bot] + categories: + - title: Breaking Changes 🛠 + labels: + - breaking-change + - title: Exciting New Features 🎉 + labels: + - enhancement + - title: Other Changes + labels: + - "*" diff --git a/.github/workflows/changelog-pr-update.yml b/.github/workflows/changelog-pr-update.yml deleted file mode 100644 index f1fc6bc..0000000 --- a/.github/workflows/changelog-pr-update.yml +++ /dev/null @@ -1,18 +0,0 @@ -# name: Check Changelog Update on PR -# on: -# pull_request: -# types: [assigned, opened, synchronize, reopened, labeled, unlabeled] -# branches: -# - main -# - develop -# paths-ignore: -# - .pre-commit-config.yaml -# - .readthedocs.yaml -# jobs: -# Check-Changelog: -# name: Check Changelog Action -# runs-on: ubuntu-20.04 -# steps: -# - uses: tarides/changelog-check-action@v2 -# with: -# changelog: CHANGELOG.md diff --git a/.github/workflows/changelog-release-update.yml b/.github/workflows/changelog-release-update.yml deleted file mode 100644 index 9ba69d1..0000000 --- a/.github/workflows/changelog-release-update.yml +++ /dev/null @@ -1,45 +0,0 @@ -# .github/workflows/update-changelog.yaml -name: "Update Changelog" - -on: - workflow_run: - workflows: - - Upload Python Package - types: - - completed - -permissions: - pull-requests: write - contents: write - -jobs: - update: - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ github.event.release.target_commitish }} - - - name: Update Changelog - uses: stefanzweifel/changelog-updater-action@v1 - with: - latest-version: ${{ github.event.release.tag_name }} - heading-text: ${{ github.event.release.name }} - release-notes: ${{ github.event.release.body }} - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v6 - with: - branch: docs/changelog-update-${{ github.event.release.tag_name }} - base: develop - title: '[Changelog] Update to ${{ github.event.release.tag_name }}' - body: | - This PR updates the changelog to include the changes in the latest release. - - > [!CAUTION] - > Merge DO NOT squash to correctly update the tag version of `develop` branch. - add-paths: | - CHANGELOG.md diff --git a/.github/workflows/merge-main-into-develop.yml b/.github/workflows/merge-main-into-develop.yml new file mode 100644 index 0000000..2237ea5 --- /dev/null +++ b/.github/workflows/merge-main-into-develop.yml @@ -0,0 +1,31 @@ +name: Merge main into develop +on: + push: + branches: + - main + + +permissions: + # Needed to read branches + contents: read + # Needed to create PR's + pull-requests: write + +jobs: + sync-branches: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Opening pull request + id: pull + uses: jdtx0/branch-sync@1.5.1 + with: + GITHUB_TOKEN: ${{ secrets.REPO_SYNC_ACTION_PAT }} + FROM_BRANCH: "main" + TO_BRANCH: "develop" + PULL_REQUEST_AUTO_MERGE_METHOD: "merge" diff --git a/.github/workflows/pr-conventional-commit.yml b/.github/workflows/pr-conventional-commit.yml new file mode 100644 index 0000000..1f18a42 --- /dev/null +++ b/.github/workflows/pr-conventional-commit.yml @@ -0,0 +1,21 @@ +name: "Ensure Conventional Commit in PR title" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + - reopened + +permissions: + pull-requests: read + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..c317b5e --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,24 @@ +name: Run Release Please +on: + push: + branches: + - develop + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + with: + # this assumes that you have created a personal access token + # (PAT) and configured it as a GitHub action secret named + # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important). + token: ${{ secrets.REPO_SYNC_ACTION_PAT }} + # optional. customize path to .release-please-config.json + config-file: .release-please-config.json + # Currently releases are done "from main" to have a stable branch + target-branch: main diff --git a/.gitignore b/.gitignore index d4a8551..05f0877 100644 --- a/.gitignore +++ b/.gitignore @@ -173,7 +173,6 @@ bar *.grib *.nc *.npz -*.json *.zarr/ ~$images.pptx test.py diff --git a/.release-please-config.json b/.release-please-config.json new file mode 100644 index 0000000..e6d63d2 --- /dev/null +++ b/.release-please-config.json @@ -0,0 +1,14 @@ +{ + "release-type": "python", + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "separate-pull-requests": true, + "always-update": true, + "changelog-type": "github", + "packages": { + ".": { + "package-name": "anemoi-utils" + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..e69de29