Skip to content

Commit

Permalink
build: robot builds for all release types (#13306)
Browse files Browse the repository at this point in the history
* build: robot builds for all release types

* allow other release branch format in robot builds

* truncate changelogs if necessary

* handle limiting the message more readably
  • Loading branch information
sfoster1 authored Aug 15, 2023
1 parent 59a5889 commit 4772b11
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: 'Start Internal-Release OT-3 build'
name: 'Start Flex build'
on:
push:
branches:
- edge
- '*internal-release*'
- 'release*'
- 'chore_release*'
tags:
- ot3@*
- v*
pull_request:
types:
- opened
Expand All @@ -16,7 +19,7 @@ jobs:
handle-push:
runs-on: 'ubuntu-latest'
if: github.event_name == 'push'
name: "Start an OT-3 build for a branch/tag push"
name: "Start a Flex build for a branch/tag push"
steps:
- name: 'start build'
uses: octokit/[email protected]
Expand All @@ -39,7 +42,7 @@ jobs:
handle-pr:
runs-on: 'ubuntu-latest'
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'Opentrons/opentrons' && contains(github.event.pull_request.labels.*.name, 'ot3-build')
name: "Start an OT-3 build for a requested PR"
name: "Start a Flex build for a requested PR"
steps:
- name: 'start build'
uses: octokit/[email protected]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: 'Start Internal-Release OT-2 build'
name: 'Start OT-2 build'
on:
push:
branches:
- edge
- '*internal-release*'
- 'release*'
- 'chore_release*'
tags:
- ot3@*
- v*
pull_request:
types:
- opened
Expand Down
19 changes: 18 additions & 1 deletion scripts/deploy/create-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,17 @@ async function createRelease(token, tag, project, version, changelog, deploy) {
}
}

function truncateAndAnnotate(changelog, limit, prevtag, thistag) {
const linkmessage = `\n...and more! Log link: https://github.com/${REPO_DETAILS.owner}/${REPO_DETAILS.repo}/compare/${prevtag}...${thistag}`
const limitWithMessage = limit - linkmessage.length
if (changelog.length < limitWithMessage) {
return changelog
}
const truncated = changelog.substring(0, limitWithMessage)

return truncated + linkmessage
}

async function main() {
const { args, flags } = parseArgs(process.argv.slice(2))

Expand All @@ -197,12 +208,18 @@ async function main() {
currentVersion,
previousVersion
)
const truncatedChangelog = truncateAndAnnotate(
changelog,
10000,
prefixForProject(project) + previousVersion,
prefixForProject(project) + currentVersion
)
return await createRelease(
token,
tag,
project,
currentVersion,
changelog,
truncatedChangelog,
deploy
)
}
Expand Down

0 comments on commit 4772b11

Please sign in to comment.