Skip to content

feat(weather): add Android home screen weather widgets #1624

feat(weather): add Android home screen weather widgets

feat(weather): add Android home screen weather widgets #1624

Workflow file for this run

name: Build iOS
# Pull requests, and the pushes to `main` that publish no snapshot. A push
# that does is handled by release.yml, which builds the signed, uploadable
# artifact — running this as well would spend a second runner producing an
# unsigned one nobody installs. One that does not would otherwise be built by
# nothing at all.
#
# Every pull request, not only the ones targeting `main`. A stacked branch
# opens its pull request against the layer below it, so `branches: [main]`
# silently excluded exactly the reviews that most needed a compiler: the ones
# where only the top of the stack is ever read against `main`. Four iOS-only
# commits reached review that way without Swift being built once.
on:
pull_request:
push:
branches: [main]
# One in-flight run per ref; a new push cancels the previous run. This matters
# more now that the trigger is every pull request: restacking a five-deep chain
# pushes five branches at once, and each one wants a macOS runner.
concurrency:
group: ios-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
ios: ${{ steps.filter.outputs.ios }}
release: ${{ steps.release.outputs.builds }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Nothing here pushes or fetches, so the job token is not left in
# .git/config for the steps after this one.
persist-credentials: false
# A push reads its own commit messages below: full history, without
# the file contents nothing here looks at.
fetch-depth: ${{ github.event_name == 'push' && '0' || '1' }}
filter: ${{ github.event_name == 'push' && 'blob:none' || '' }}
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
id: filter
with:
filters: |
ios:
- 'ios/**'
- 'assets/**'
- 'lib/**'
- 'pubspec.yaml'
# Whether release.yml builds this push, for the job below. It publishes
# a snapshot only when a commit since the last tag carries a changelog
# entry; asked here of the push's own commits, which are always within
# that range. So "yes" here is always "yes" there, and a push this
# answers "no" for is built here — at worst by both, never by neither.
- name: Does release.yml build this push
id: release
if: github.event_name == 'push'
env:
BEFORE: ${{ github.event.before }}
run: |
if bash tool/release/notes.sh --any "$BEFORE..$GITHUB_SHA"; then
echo "builds=true" >> "$GITHUB_OUTPUT"
echo "this push brings a changelog entry: release.yml builds it"
else
echo "builds=false" >> "$GITHUB_OUTPUT"
echo "no changelog entry in this push: no snapshot, so it is built here"
fi
iOS:
needs: changes
if: ${{ needs.changes.outputs.ios == 'true' && needs.changes.outputs.release != 'true' }}
runs-on: macos-latest
permissions:
contents: read
steps:
# Nothing here pushes, so the job token is not left in .git/config.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Flutter and Dart come from mise.toml, the same pin CI and every laptop
# use. Not subosito/flutter-action with `channel: stable`: that resolves
# to whatever stable is on the day, so this job could ship an artifact
# built against an SDK nobody chose, and nothing in the build log would
# say so. See AGENTS.md → Toolchain.
- name: Install toolchain (mise)
uses: jdx/mise-action@2d8d4cafcbd33be2ea37d2b6f5ad595363d1f1ca # v5.1.1
# The iOS build uses Swift Package Manager, not CocoaPods (there is no
# Podfile). Cache SPM's clone/artifact store keyed on the resolved pins.
- name: Cache Swift Packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
# build/ios/SourcePackages, not DerivedData. Flutter always passes
# -clonedSourcePackagesDirPath pointing there (ios/xcodeproj.dart), so
# DerivedData is never consulted for packages and caching it stored
# nothing. Losing this directory is what makes a launch print fifteen
# "Fetching from … (cached)" lines and cost 19-32 s.
#
# The DerivedData line is release.yml's, whose xcodebuild archive does
# clone there; nothing in this job writes it. It is listed so the two
# lists match line for line: a cache entry's version is a hash of these
# paths, and only an identical list lets this job restore the entry
# main saved instead of storing a fresh ~880 MB copy per pull request.
path: |
~/Library/Caches/org.swift.swiftpm
build/ios/SourcePackages
~/Library/Developer/Xcode/DerivedData/**/SourcePackages
key: ${{ runner.os }}-spm-${{ hashFiles('ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Install dependencies and run build_runner
run: |
bash tool/dev/deps.sh
bash tool/dev/codegen.sh
# Before the device build, because it is the step that can fail on
# something a reviewer would have had to catch by eye. It builds the
# Runner scheme, which depends on DPIPWidgetsExtension, so the widget
# target and its SwiftUI views are compiled here as well — nothing else
# in this repository compiles them.
- name: Test (ios/RunnerTests)
run: bash tool/dev/test_ios.sh
- name: Build iOS App and create IPA
run: |
bash tool/dev/build.sh ios --debug
mkdir -p Payload
cp -R build/ios/iphoneos/Runner.app Payload/Runner.app
zip -qr DPIP.ipa Payload
- name: Upload Artifacts
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: DPIP-iOS
path: |
build/ios/iphoneos/Runner.app
DPIP.ipa
retention-days: 7
compression-level: 6