Skip to content

Commit

Permalink
Merge branch 'main' into atavism/webview-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
atavism committed Nov 12, 2024
2 parents e284651 + 53d3c60 commit 6601eec
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 19 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ jobs:
- name: Granting private modules access
run: git config --global url."https://${{ secrets.GH_TOKEN }}:[email protected]/".insteadOf "https://github.com/"

- name: Setup protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install latest protoc-gen-go
run: go install github.com/golang/protobuf/protoc-gen-go@latest

Expand Down Expand Up @@ -233,14 +238,18 @@ jobs:
echo "VideoInterstitialZoneId=$TAPSELL_VIDEO_INTERSTITIAL_ZONE_ID" >> app.env
echo "InterstitialZoneId=$TAPSELL_INTERSTITIAL_ZONE_ID" >> app.env
- name: Setup protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Extract app version from pubspec.yaml
id: extract_version
shell: bash
run: |
APP_VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //')
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
- name: Build Lantern Library
shell: bash
run: make ${{matrix.platform}}
env:
VERSION: ${{ env.version }}

- name: Activate plugins
run: |
Expand Down Expand Up @@ -270,32 +279,25 @@ jobs:
mkdir -p "build/windows/${{inputs.windows-arch}}/runner/Release"
mv liblantern.dll "build/windows/${{inputs.windows-arch}}/runner/Release"
- name: Extract app version from pubspec.yaml
id: extract_version
shell: bash
run: |
APP_VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //')
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
- name: Build Flutter app (Windows)
if: matrix.platform == 'windows'
run: |
New-Item -Path "./dist/${{ env.APP_VERSION }}" -ItemType Directory -Force
flutter_distributor package --platform windows --targets exe --skip-clean
env:
VERSION: "${{ env.version }}"
VERSION: ${{ env.version }}

- name: Build Flutter app (Android)
if: matrix.platform == 'android'
run: make ${{ matrix.platform }}-${{ matrix.target }}-release
env:
VERSION: "${{ env.version }}"
VERSION: ${{ env.version }}

- name: Build Flutter app
if: matrix.platform != 'windows' && matrix.platform != 'android'
run: make ${{ matrix.platform }}-release
env:
VERSION: "${{ env.version }}"
VERSION: ${{ env.version }}

- name: Rename installer
if: matrix.platform == 'windows'
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ jobs:
run: |
git config --global url."https://${{ secrets.CI_PRIVATE_REPOS_GH_TOKEN }}:[email protected]/".insteadOf "https://github.com/"
- name: Setup protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install latest protoc-gen-go
run: go install github.com/golang/protobuf/protoc-gen-go@latest

- name: Build
run: LIB_NAME=liblantern.so make lantern

Expand Down
26 changes: 21 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ CIBASE := $(shell printf "CI=$${CI:-false}" | base64)
STAGING = false
UPDATE_SERVER_URL ?=
VERSION ?= 9999.99.99
# Note - we don't bother stripping symbols or DWARF table as Android's packaging seems to take care of that for us
LDFLAGS := -X github.com/getlantern/lantern-client/internalsdk/common.RevisionDate=$(REVISION_DATE) \
-X github.com/getlantern/lantern-client/internalsdk/common.ApplicationVersion=$(VERSION) \
-X github.com/getlantern/lantern-client/internalsdk/common.BuildDate=$(BUILD_DATE)

LDFLAGS := -X github.com/getlantern/lantern-client/internalsdk/common.RevisionDate=$(REVISION_DATE) -X github.com/getlantern/lantern-client/internalsdk/common.BuildDate=$(BUILD_DATE)

# Ref https://pkg.go.dev/cmd/link
# -w omits the DWARF table
Expand Down Expand Up @@ -217,6 +215,20 @@ dumpvars:
$(filter-out $(VARS_OLD) VARS_OLD,$(.VARIABLES)), \
$(info $(v) = $($(v))))

EXTRA_LDFLAGS ?=

ifdef VERSION
EXTRA_LDFLAGS += -X github.com/getlantern/lantern-client/internalsdk/common.ApplicationVersion=$(VERSION)
endif

ifdef REPLICA
EXTRA_LDFLAGS += -X github.com/getlantern/antern-client/desktop/features.EnableReplicaFeatures=$(REPLICA)
endif

ifdef TRAFFICLOG
EXTRA_LDFLAGS += -X github.com/getlantern/lantern-client/desktop/features.EnableTrafficlogFeatures=true
endif

.PHONY: tag
tag: require-version
@(git diff-index --quiet HEAD -- || (echo "Attempted to tag dirty working tree" && exit 1)) && \
Expand All @@ -242,6 +254,10 @@ require-app: guard-APP

.PHONY: require-version
require-version: guard-VERSION
@if ! [[ "$$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-.+)?$$ ]]; then \
echo "VERSION must be a semantic version like '1.2.10' or '1.2.10-foo"; \
exit 1; \
fi

.PHONY: require-sentry-auth-token
require-secrets-dir: guard-SENTRY_AUTH_TOKEN
Expand Down Expand Up @@ -469,7 +485,7 @@ echo-build-tags: ## Prints build tags and extra ldflags. Run this with `REPLICA=
.PHONY: desktop-lib ffigen

desktop-lib: export GOPRIVATE = github.com/getlantern
desktop-lib: echo-build-tags
desktop-lib: $(GO_SOURCES) echo-build-tags
CGO_ENABLED=1 go build -v -trimpath $(GO_BUILD_FLAGS) -o "$(LIB_NAME)" -tags="$(BUILD_TAGS)" -ldflags="$(LDFLAGS) $(EXTRA_LDFLAGS)" desktop/*.go

# This runs a development build for lantern. For production builds, see
Expand Down

0 comments on commit 6601eec

Please sign in to comment.