From 860e0bf3d35d99279e8fef3cb8219af36a7e25a3 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Sun, 2 Jul 2023 14:37:09 +0100 Subject: [PATCH] ci: release from main for most types (#136) Upgrade deps weekly, forcing a weekly release at minimum --- .github/workflows/release.yml | 5 +++-- .github/workflows/upgrade-main.yml | 2 +- .projen/tasks.json | 6 ++++-- .projenrc.ts | 23 +++++++++++++++++++---- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a426a0..9c8ebdd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,9 @@ name: release on: - schedule: - - cron: 0 5 1 * * + push: + branches: + - main workflow_dispatch: {} jobs: release: diff --git a/.github/workflows/upgrade-main.yml b/.github/workflows/upgrade-main.yml index 715c4f5..49b2644 100644 --- a/.github/workflows/upgrade-main.yml +++ b/.github/workflows/upgrade-main.yml @@ -4,7 +4,7 @@ name: upgrade-main on: workflow_dispatch: {} schedule: - - cron: 0 0 * * * + - cron: 0 0 * * 1 jobs: upgrade: name: Upgrade diff --git a/.projen/tasks.json b/.projen/tasks.json index a0468c8..4fce607 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -32,7 +32,8 @@ "CHANGELOG": "dist/changelog.md", "BUMPFILE": "dist/version.txt", "RELEASETAG": "dist/releasetag.txt", - "RELEASE_TAG_PREFIX": "" + "RELEASE_TAG_PREFIX": "", + "RELEASABLE_COMMITS": "git log --no-merges --oneline $LATEST_TAG..HEAD -E --grep '^(feat|fix|chore|revert|docs){1}(\\([^()[:space:]]+\\))?(!)?:[[:blank:]]+.+'" }, "steps": [ { @@ -208,7 +209,8 @@ "CHANGELOG": "dist/changelog.md", "BUMPFILE": "dist/version.txt", "RELEASETAG": "dist/releasetag.txt", - "RELEASE_TAG_PREFIX": "" + "RELEASE_TAG_PREFIX": "", + "RELEASABLE_COMMITS": "git log --no-merges --oneline $LATEST_TAG..HEAD -E --grep '^(feat|fix|chore|revert|docs){1}(\\([^()[:space:]]+\\))?(!)?:[[:blank:]]+.+'" }, "steps": [ { diff --git a/.projenrc.ts b/.projenrc.ts index 9ddc44c..626f578 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -1,4 +1,10 @@ -import { github, javascript, release, TextFile, typescript } from 'projen'; +import { + github, + javascript, + ReleasableCommits, + TextFile, + typescript, +} from 'projen'; const project = new typescript.TypeScriptProject({ projenrcTs: true, @@ -36,6 +42,11 @@ const project = new typescript.TypeScriptProject({ }, }, }, + depsUpgradeOptions: { + workflowOptions: { + schedule: javascript.UpgradeDependenciesSchedule.WEEKLY, + }, + }, autoApproveUpgrades: true, autoApproveOptions: { allowedUsernames: [ @@ -49,9 +60,13 @@ const project = new typescript.TypeScriptProject({ releaseToNpm: true, npmAccess: javascript.NpmAccess.PUBLIC, defaultReleaseBranch: 'main', - releaseTrigger: release.ReleaseTrigger.scheduled({ - schedule: '0 5 1 * *', - }), + releasableCommits: ReleasableCommits.ofType([ + 'feat', + 'fix', + 'chore', + 'revert', + 'docs', + ]), // Dependencies deps: ['@jsii/spec', '@ungap/structured-clone@~1.0.0'],