Skip to content

Commit

Permalink
build: fix project, fix release type (#96)
Browse files Browse the repository at this point in the history
* fix: actually set project for python builds

We were doing it for environment variables but not when we calculated
the versions.

* fix: release builds for release tags
  • Loading branch information
sfoster1 authored Aug 15, 2023
1 parent 49b1047 commit 44f6c56
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 9 deletions.
7 changes: 6 additions & 1 deletion .github/actions/build-refs/action/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,15 @@ const BUILD_TYPE_TEST_SPECS: Array<[string, [Ref], BuildType]> = [
'develop',
],
[
'when monorepo ref is a release tag is release',
'when monorepo ref is an internal-release tag is release',
['refs/tags/ot3@0.0.0-dev'],
'release',
],
[
'when monorepo ref is a release tag is release',
['refs/tags/v12.12.9-alpha.12'],
'release',
],
]

BUILD_TYPE_TEST_SPECS.forEach(
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build-refs/action/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ async function resolveRefs(toAttempt: AttemptableRefs): Promise<OutputRefs> {
}

export function resolveBuildType(ref: Ref): BuildType {
return ref.includes('refs/tags/ot3') ? 'release' : 'develop'
return ref.includes('refs/tags') ? 'release' : 'develop'
}

async function run() {
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build-refs/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9885,7 +9885,7 @@ function resolveRefs(toAttempt) {
});
}
function resolveBuildType(ref) {
return ref.includes('refs/tags/ot3') ? 'release' : 'develop';
return ref.includes('refs/tags') ? 'release' : 'develop';
}
function run() {
return __awaiter(this, void 0, void 0, function* () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def get_ot_package_version(d):
try:
sys.path.append(os.path.join(s, 'scripts'))
from python_build_utils import get_version
return get_version(d.getVar('OT_PACKAGE', 'robot-server'), 'ot3')
return get_version(d.getVar('OT_PACKAGE', 'robot-server'), d.getVar('OPENTRONS_PROJECT', 'ot3'))
finally:
sys.path = sys.path[:-1]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ do_install_append () {

# create json file to be used in VERSION.json
install -d ${D}/opentrons_versions
python3 ${S}/scripts/python_build_utils.py robot-server ot3 dump_br_version > ${D}/opentrons_versions/opentrons-robot-server-version.json
python3 ${S}/scripts/python_build_utils.py api ot3 dump_br_version > ${D}/opentrons_versions/opentrons-api-version.json
python3 ${S}/scripts/python_build_utils.py robot-server ${OPENTRONS_PROJECT} dump_br_version > ${D}/opentrons_versions/opentrons-robot-server-version.json
python3 ${S}/scripts/python_build_utils.py api ${OPENTRONS_PROJECT} dump_br_version > ${D}/opentrons_versions/opentrons-api-version.json

install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/opentrons-robot-server.service ${D}${systemd_system_unitdir}/opentrons-robot-server.service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ addtask do_write_systemd_dropfile after do_compile before do_install
do_install_append () {
# create json file to be used in VERSION.json
install -d ${D}/opentrons_versions
python3 ${S}/scripts/python_build_utils.py system-server ot3 dump_br_version > ${D}/opentrons_versions/opentrons-system-server-version.json
python3 ${S}/scripts/python_build_utils.py system-server ${OPENTRONS_PROJECT} dump_br_version > ${D}/opentrons_versions/opentrons-system-server-version.json

install -d ${D}/${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/opentrons-system-server.service ${D}/${systemd_system_unitdir}/opentrons-system-server.service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ PIPENV_APP_BUNDLE_EXTRA_PIP_ENVARGS = "OPENTRONS_PROJECT=${OPENTRONS_PROJECT}"
do_install_append() {
# create json file to be used in VERSION.json
install -d ${D}/opentrons_versions
python3 ${S}/scripts/python_build_utils.py update-server ot3 dump_br_version > ${D}/opentrons_versions/opentrons-update-server-version.json
python3 ${S}/scripts/python_build_utils.py update-server ${OPENTRONS_PROJECT} dump_br_version > ${D}/opentrons_versions/opentrons-update-server-version.json

install -d ${D}/${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/opentrons-update-server.service ${D}/${systemd_unitdir}/system
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ PIPENV_APP_BUNDLE_EXTRA_PIP_ENVARGS = "OPENTRONS_PROJECT=${OPENTRONS_PROJECT}"
do_install_append() {
# create json file to be used in VERSION.json
install -d ${D}/opentrons_versions
python3 ${S}/scripts/python_build_utils.py usb-bridge ot3 dump_br_version > ${D}/opentrons_versions/opentrons-usb-bridge-version.json
python3 ${S}/scripts/python_build_utils.py usb-bridge ${OPENTRONS_PROJECT} dump_br_version > ${D}/opentrons_versions/opentrons-usb-bridge-version.json

install -d ${D}/${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/opentrons-usb-bridge.service ${D}/${systemd_system_unitdir}/opentrons-usb-bridge.service
Expand Down

0 comments on commit 44f6c56

Please sign in to comment.