Skip to content
Merged
Show file tree
Hide file tree
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
49 changes: 31 additions & 18 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ on:

jobs:
build-ios:
runs-on: [self-hosted, macOS]
runs-on: [self-hosted, macOS, native]
defaults:
run:
working-directory: ./client
steps:
- name: Checkout main repo
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
submodules: "recursive"

Expand All @@ -40,7 +40,7 @@ jobs:
run: flutter pub get

- name: Unlock Keychain
run: security -v unlock-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" /Users/admin/Library/Keychains/login.keychain
run: security unlock-keychain -p "${{ secrets.BUILD_KEYCHAIN_PASSWORD }}" build.keychain

- name: Create BoringTun directory
run: mkdir -p ios/VPNExtension/BoringTun
Expand All @@ -54,32 +54,45 @@ jobs:
- name: Build iOS
run: flutter build ipa --release --obfuscate --split-debug-info=build/debug-info --build-number=${{ github.run_number }}

- name: Get last commit message
run: echo "COMMIT_MSG=$(git log -1 --pretty=%B)" >> $GITHUB_ENV

- name: Upload app to TestFlight
uses: apple-actions/upload-testflight-build@v5
# Mobile applications are published to the App Store manually, with release tags applied
# post-publication. To avoid redundant uploads, this step executes only for non-tagged
# builds, ensuring tagged releases are distributed exclusively to GitHub.
if: "!startsWith(github.ref, 'refs/tags/')"
with:
app-path: "client/build/ios/ipa/Defguard.ipa"
issuer-id: ${{ secrets.API_ISSUER_ID }}
api-key-id: ${{ secrets.ASC_API_KEY_ID }}
api-private-key: ${{ secrets.PRIVATE_KEY_CONTENTS }}
release-notes: ${{ env.COMMIT_MSG }}
run: |
xcrun altool --api-key ${{ secrets.ASC_API_KEY_ID }} \
--api-issuer ${{ secrets.API_ISSUER_ID }} \
--upload-app --platform ios --file build/ios/ipa/Defguard.ipa --wait

- name: Upload What's New
env:
APP_ID: "6748068630"
run: |
UPLOAD_DIR=$(mktemp -d)
VERSION=$(grep '^version:' pubspec.yaml | cut -d ' ' -f 2 | cut -d '+' -f 1)
mkdir -p "${UPLOAD_DIR}/beta-${APP_ID}/upload/IOS"
git log -1 --pretty='"whatsNew" = "%B";' > "${UPLOAD_DIR}/beta-${APP_ID}/upload/IOS/en-GB.txt"
RETRIES=0
until [ ${RETRIES} -gt 6 ]
do
xcrun altool --api-key ${{ secrets.ASC_API_KEY_ID }} --api-issuer ${{ secrets.API_ISSUER_ID }} \
--apple-id ${APP_ID} --bundle-version ${{ github.run_number }} \--bundle-short-version-string ${VERSION} \
--platform macos --beta-app-store-text "${UPLOAD_DIR}" --upload && break
echo "Waiting for app ${APP_ID} build ${{ github.run_number }} version ${VERSION}"
sleep 10
((RETRIES++))
done
rm -f -r "${UPLOAD_DIR}"

build-android:
runs-on: [self-hosted, macOS]
runs-on: [self-hosted, macOS, native]
env:
ANDROID_HOME: /Users/admin/Library/Android/sdk
ANDROID_SDK_ROOT: /Users/admin/Library/Android/sdk
defaults:
run:
working-directory: ./client
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
submodules: "recursive"

Expand Down Expand Up @@ -141,15 +154,15 @@ jobs:
retention-days: 2

build-android-apk:
runs-on: [self-hosted, macOS]
runs-on: [self-hosted, macOS, native]
env:
ANDROID_HOME: /Users/admin/Library/Android/sdk
ANDROID_SDK_ROOT: /Users/admin/Library/Android/sdk
defaults:
run:
working-directory: ./client
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
submodules: "recursive"

Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/lint-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
submodules: "recursive"

Expand Down Expand Up @@ -57,15 +57,15 @@ jobs:

# test-ios:
# name: Run iOS tests
# runs-on: [self-hosted, macOS]
# runs-on: [self-hosted, macOS, native]
# needs: lint
# defaults:
# run:
# working-directory: ./client/ios

# steps:
# - name: Checkout
# uses: actions/checkout@v6
# uses: actions/checkout@v7
# with:
# submodules: "recursive"

Expand All @@ -90,8 +90,5 @@ jobs:
# # - name: build project
# # run: flutter build ios

# - name: Unlock Keychain
# run: security -v unlock-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" /Users/admin/Library/Keychains/login.keychain

# - name: run plugin tests
# run: xcodebuild test -workspace Runner.xcworkspace -scheme Runner
2 changes: 1 addition & 1 deletion .github/workflows/sbom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
ref: ${{ steps.vars.outputs.TAG_NAME }}
submodules: "recursive"
Expand Down