Skip to content
Merged
Changes from all 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
23 changes: 19 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ TELEPORT_DEBUG ?= false
GITTAG=v$(VERSION)
CGOFLAG ?= CGO_ENABLED=1

# RELEASE_DIR is where the release artifacts (tarballs, pacakges, etc) are put. It
# should be an absolute directory as it is used by e/Makefile too, from the e/ directory.
RELEASE_DIR := $(CURDIR)/$(BUILDDIR)/artifacts

# When TELEPORT_DEBUG is true, set flags to produce
# debugger-friendly builds.
ifeq ("$(TELEPORT_DEBUG)","true")
Expand Down Expand Up @@ -387,6 +391,11 @@ clean-ui:
#
# make release - Produces a binary release tarball.
#

# RELEASE_DIR is where release artifact files are put, such as tarballs, packages, etc.
$(RELEASE_DIR):
mkdir $@

.PHONY:
export
release:
Expand Down Expand Up @@ -420,7 +429,7 @@ release-arm64:
# make build-archive - Packages the results of a build into a release tarball
#
.PHONY: build-archive
build-archive:
build-archive: | $(RELEASE_DIR)
@echo "---> Creating OSS release archive."
mkdir teleport
cp -rf $(BUILDDIR)/* \
Expand All @@ -431,6 +440,7 @@ build-archive:
teleport/
echo $(GITTAG) > teleport/VERSION
tar $(TAR_FLAGS) -c teleport | gzip -n > $(RELEASE).tar.gz
cp $(RELEASE).tar.gz $(RELEASE_DIR)
rm -rf teleport
@echo "---> Created $(RELEASE).tar.gz."

Expand Down Expand Up @@ -537,11 +547,14 @@ release-windows: release-windows-unsigned
# details.
#
.PHONY: release-connect
release-connect:
release-connect: | $(RELEASE_DIR)
$(eval export CSC_NAME)
yarn install --frozen-lockfile
yarn build-term
yarn package-term -c.extraMetadata.version=$(VERSION)
if [ -n "$$CONNECT_TSH_APP_PATH" ]; then \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need to check CONNECT_TSH_APP_PATH before copying the dmg? The comment above release-connect says that this target is used only in macOS, in which case the dmg should always be present after a successful yarn package-term.

Copy link
Copy Markdown
Contributor Author

@camscale camscale Dec 1, 2023

Choose a reason for hiding this comment

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

This is discriminating between CONNECT_TSH_APP_PATH and CONNECT_TSH_BIN_PATH. The former is set when we are building release packages. On a push build we don't care about saving the package, and that uses CONNECT_TSH_BIN_PATH.

https://github.com/gravitational/teleport.e/blob/branch/v12/.github/workflows/build-mac-amd64.yaml#L193 and the step after the highlighted line.

I will shortly be revisiting the whole copying artifact thing when we stop using Drone to do any of this. I may revise this logic then to be more straightforward. But for now I'll keep the branches in line with each other as much as I can.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oops, I forgot that it does push builds too, I thought it's just for tag builds.

cp web/packages/teleterm/build/release/"Teleport Connect-"*.dmg $(RELEASE_DIR); \
fi

#
# Remove trailing whitespace in all markdown files under docs/.
Expand Down Expand Up @@ -1135,23 +1148,25 @@ endif

# build .pkg
.PHONY: pkg
pkg:
pkg: | $(RELEASE_DIR)
$(eval export DEVELOPER_ID_APPLICATION DEVELOPER_ID_INSTALLER)
mkdir -p $(BUILDDIR)/
cp ./build.assets/build-package.sh ./build.assets/build-common.sh $(BUILDDIR)/
chmod +x $(BUILDDIR)/build-package.sh
# arch and runtime are currently ignored on OS X
# we pass them through for consistency - they will be dropped by the build script
cd $(BUILDDIR) && ./build-package.sh -t oss -v $(VERSION) -p pkg -b $(TELEPORT_BUNDLEID) -a $(ARCH) $(RUNTIME_SECTION) $(TARBALL_PATH_SECTION)
cp $(BUILDDIR)/teleport-*.pkg $(RELEASE_DIR)
if [ -f e/Makefile ]; then $(MAKE) -C e pkg; fi

# build tsh client-only .pkg
.PHONY: pkg-tsh
pkg-tsh:
pkg-tsh: | $(RELEASE_DIR)
$(eval export DEVELOPER_ID_APPLICATION DEVELOPER_ID_INSTALLER)
./build.assets/build-pkg-tsh.sh -t oss -v $(VERSION) -b $(TSH_BUNDLEID) $(TARBALL_PATH_SECTION)
mkdir -p $(BUILDDIR)/
mv tsh*.pkg* $(BUILDDIR)/
cp $(BUILDDIR)/tsh-*.pkg $(RELEASE_DIR)

# build .rpm
.PHONY: rpm
Expand Down