Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
347dc51
Tier 1 modernization: GitHub URLs, SPM-only, pinned CommonFastfile ve…
iggyto Nov 27, 2026
d68b858
Move build/test logic into shared fastlane lanes, add .gitignore
iggyto Nov 27, 2026
2ea38b3
Add GitHub Actions and Jenkins templates, ASC API key helper for CI
iggyto Nov 27, 2026
bdc216d
Replace slather/xchtmlreport with trainer + xccov, xcode-install with…
iggyto Nov 27, 2026
9e5106a
Rename beta lane/helper to ship_testflight/iq_testflight, keep iq_bet…
iggyto Nov 27, 2026
64acf5c
Add end-to-end smoke test and CI for this repo; fix bugs it found
iggyto Nov 27, 2026
7e620ec
Stop pinning versions: latest stable Ruby at generation time; add doc…
iggyto Nov 27, 2026
b06a4ae
Pin a tested Ruby in versions.env, bump it automatically with a weekl…
iggyto Nov 27, 2026
9f2bc51
Split repo CI: always-on lint, smoke test only on relevant paths
iggyto Nov 27, 2026
6ef3b0c
Fix lint workflow: block scalar so #{f} is not read as a YAML comment
iggyto Nov 27, 2026
78a9b4b
Activate rbenv in the generator after setup.sh and in doctor.sh
iggyto Nov 27, 2026
c7b0ba0
Add check_certs, sync_devices, lint and bump_version lanes
iggyto Nov 27, 2026
ad07821
setup.sh: fall back to upstream ruby-build when Homebrew's does not k…
iggyto Nov 27, 2026
a6bf29e
Smoke test: developer-like shell (UTF-8, rbenv); doctor: locale check
iggyto Nov 27, 2026
edf7bf5
Address review: empty env secrets, build log name, job name sanitizin…
iggyto Nov 30, 2026
90d0dbc
Build-only runs write no cobertura.xml (Coverage plugin rejects an em…
iggyto Dec 1, 2026
5a08cc4
CHANGELOG: date the 2.0.0 release
iggyto Dec 2, 2026
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
26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Cheap syntax checks, on every pull request.
name: Lint

on:
pull_request:
push:
branches: [master]

concurrency:
group: lint-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
- name: Shell syntax
run: |
for f in create_setup_build_scripts.sh samples/*.sh xcinstall/*.sh tests/*.sh templates/*.sh; do bash -n "$f" && echo "ok $f"; done
- name: Ruby syntax
run: |
for f in fastlane/CommonFastfile samples/*.rb; do ruby -c "$f" > /dev/null && echo "ok $f"; done
- name: YAML is valid
run: |
ruby -ryaml -e 'ARGV.each { |f| YAML.load_file(f, aliases: true); puts "ok #{f}" }' templates/github-actions/*.yml .github/workflows/*.yml
40 changes: 40 additions & 0 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# End-to-end test (tests/smoke.sh): generates a sample iOS project, runs the generator on it, then
# build / tests / warnings / coverage / doctor. Slow (macOS + simulator), so it only runs when something
# that ends up in generated projects, or the test itself, changes.
name: Smoke test

on:
pull_request:
paths: &paths
- create_setup_build_scripts.sh
- fastlane/**
- templates/**
- samples/**
- xcinstall/**
- tests/**
- versions.env
- .github/workflows/smoke.yml
push:
branches: [master]
paths: *paths
workflow_dispatch:

concurrency:
group: smoke-${{ github.ref }}
cancel-in-progress: true

jobs:
lanes:
# Fast: portal and lint lanes with stubs (tests/lanes.sh)
runs-on: macos-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
- run: tests/lanes.sh

smoke:
runs-on: macos-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v7
- run: tests/smoke.sh
84 changes: 84 additions & 0 deletions .github/workflows/versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Keeps the versions new projects get (versions.env) current without anybody picking them:
# every Monday it tries the newest Ruby with the end-to-end smoke test; if it passes, it opens a PR bumping
# versions.env, if it fails, it opens an issue. It also reports outdated actions used in templates/.
name: Versions

on:
schedule:
- cron: "0 6 * * 1"
workflow_dispatch:

permissions:
contents: write
pull-requests: write
issues: write

jobs:
ruby:
runs-on: macos-latest
timeout-minutes: 90
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v7

- name: Find the newest stable Ruby
id: ruby
run: |
brew install rbenv > /dev/null 2>&1 || true
# Upstream ruby-build as an rbenv plugin: Homebrew's can lag behind Ruby releases
git clone -q --depth 1 https://github.com/rbenv/ruby-build.git "$(rbenv root)/plugins/ruby-build"
latest=$(rbenv install -l | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n 1)
current=$(grep -E '^RUBY_VERSION=' versions.env | cut -d= -f2)
echo "latest=$latest" >> "$GITHUB_OUTPUT"
echo "current=$current" >> "$GITHUB_OUTPUT"
echo "Pinned: $current, newest: $latest"

- name: Smoke test with the newest Ruby
id: smoke
if: steps.ruby.outputs.latest != steps.ruby.outputs.current
continue-on-error: true
env:
XCODE_SCRIPTS_RUBY: ${{ steps.ruby.outputs.latest }}
run: tests/smoke.sh

- name: Open a PR bumping versions.env
if: steps.smoke.outcome == 'success'
env:
LATEST: ${{ steps.ruby.outputs.latest }}
CURRENT: ${{ steps.ruby.outputs.current }}
run: |
branch="bump-ruby-$LATEST"
sed -i '' -e "s/^RUBY_VERSION=.*/RUBY_VERSION=$LATEST/" versions.env
git config user.name "github-actions"
git config user.email "github-actions@users.noreply.github.com"
git checkout -b "$branch"
git commit -am "Bump Ruby for new projects: $CURRENT -> $LATEST"
git push origin "$branch"
gh pr create --title "Bump Ruby for new projects: $CURRENT -> $LATEST" \
--body "tests/smoke.sh passed with Ruby $LATEST (run: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID). Merging makes it the default for newly generated projects."

- name: Open an issue when the newest Ruby breaks the setup
if: steps.smoke.outcome == 'failure'
env:
LATEST: ${{ steps.ruby.outputs.latest }}
run: |
gh label create versions --color FBCA04 --description "Dependency / version freshness" 2>/dev/null || true
gh issue create --label versions --title "Ruby $LATEST breaks the generated setup" \
--body "tests/smoke.sh failed with Ruby $LATEST: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID. New projects keep getting the version in versions.env until this is fixed."

actions:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v7
- id: check
continue-on-error: true
run: tests/check-actions.sh
- name: Open an issue for outdated actions
if: steps.check.outcome == 'failure'
run: |
gh label create versions --color FBCA04 --description "Dependency / version freshness" 2>/dev/null || true
gh issue create --label versions --title "Actions in templates/ are outdated" \
--body "tests/check-actions.sh reports newer majors: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# macOS / editors
.DS_Store
.idea/
.vscode/

# Ruby (local tooling and tests)
.bundle/
vendor/bundle/
Gemfile.lock
.ruby-version

# Artifacts produced when trying the scripts on a sample project
deriveddata/
gymbuildlog/
coverage/
fastlane/test_output/
fastlane/test_output_ui/
fastlane/report.xml
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Changelog

## 2.0.0 (2026-12-02)

Breaking: generated projects are now SPM-only, and the repo moved to GitHub.

- All URLs moved from the retired gitlab.inqbarna.com to https://github.com/InQBarna/xcode-scripts (HTTPS).
- Generated Fastfile imports `CommonFastfile` with `version: '~> 2.0'`. Releases are git tags.
- Removed CocoaPods: no `pod init`/`pod install`, no Podfile/workspace lookup; build uses `-project`.
- Homebrew prefix detected (Apple Silicon), bash shebangs, `exit 1` instead of `exit -1`.
- `build.sh`: simulator runtime and device default to the newest installed ones (override with `RUNTIME`, `DEVICE`).
- `CommonFastfile`: removed `compileBitcode`, `fastlane_version` raised to 2.242.0 (the lowest version tested).
- Build/test logic moved from the generated `build.sh` into shared lanes: `iq_build` / `iq_test` helpers in `CommonFastfile`, `build` and `test` lanes in the generated Fastfile. `build.sh` is now a thin wrapper. Warnings from Swift packages no longer count. Fixed `build.sh` bugs (inverted `JOB_NAME` check, UI tests run against a non-existent target).
- Generated `.gitignore` also ignores build/test artifacts and `fastlane/AuthKey_*.p8` / `fastlane/.env*`; this repo got a `.gitignore`.
- CI templates in `templates/` (GitHub Actions `ci.yml` and `distribute.yml`, `Jenkinsfile`), offered by the generator (`CI_PROVIDER`).
- New `iq_asc_api_key` helper: App Store Connect key from `ASC_KEY_ID` / `ASC_ISSUER_ID` / `ASC_KEY_P8` env vars (CI secrets) or a key file. The generated Fastfile only configures it for lanes other than `build`, `test`, `lint` and `bump_version` (which work offline).
- `slather` and `xchtmlreport` removed. `iq_test` reads the xcresult with fastlane's `trainer` (junit) and `xccov` (coverage, converted to `coverage/cobertura.xml` by `iq_cobertura_from_xcresult`). Results are now written even when tests fail. Build-only runs write empty junit files but no `coverage/cobertura.xml` (the Jenkins Coverage plugin fails on an empty one). The Gemfile only has `fastlane` and `xcodeproj`.
- `xcinstall/install.sh` rewritten on top of `xcodes` (`xcode-install` / `xcversion` are deprecated, `xcinstall/Gemfile` removed). `.xcode-version` (created by the generator) selects the Xcode in `build.sh` and the GitHub Actions workflow.
- TestFlight: helper renamed `iq_beta` -> `iq_testflight` and generated lane `beta` -> `ship_testflight` (a lane called `testflight` clashes with fastlane's action of the same name). `iq_beta` stays as a deprecated alias that warns, so existing `lane :beta` keep working. `INTENT=testflight` in `build.sh` / Jenkinsfile (`INTENT=appstore` still accepted by `build.sh`). Git tags stay `appstore/v...`.
- Generator can run unattended (`TEAM_ID`, `MATCH_GIT_URL`, `CI_PROVIDER`) and from a clone (`XCODE_SCRIPTS_USE_LOCAL=1`); helper scripts are no longer written to fixed `/tmp` paths.
- `tests/smoke.sh` + `tests/fixtures/SampleApp`: end-to-end test of the generator and the generated build/test setup, run by `.github/workflows/smoke.yml` (only when generator, lanes, templates, samples, tests or versions change) next to the always-on `lint.yml`. It found and fixed two bugs: `build.sh` rejected any bundler other than 2.x, and building for testing through `gym` silently dropped the test bundles (it appends its own `build` action), so unit tests could not run; `scan(build_for_testing: true)` is used instead.
- Versions come from one place, `versions.env` (Ruby 4.0.10, the version the smoke test passes with; `XCODE_SCRIPTS_RUBY=x.y.z` overrides), instead of being hardcoded in the scripts. The generator writes it to the project's `.ruby-version`; `setup.sh`, `build.sh` and the Gemfile (`ruby file: '.ruby-version'`) read it from there, so each project owns its version. Bundler is the one shipped with that Ruby, Gemfile.lock records it. CI templates use `macos-latest`; generated projects get a `dependabot.yml` for actions and gems. Verified with Ruby 4.0.10, bundler 4.0.20, fastlane 2.242.0.
- `scripts/doctor.sh` (from `templates/doctor.sh`) checks Xcode, simulator, Ruby, gems, shared scheme and coverage, fastlane files, signing and CI, a committed `.p8` key, and prints a fix for each problem (`--offline` skips network checks).
- `.github/workflows/versions.yml` (weekly): smoke-tests the newest Ruby and opens a PR bumping `versions.env` when it passes, or an issue when it fails; `tests/check-actions.sh` reports outdated actions in the templates.
- New lanes: `check_certs` (expiry report, `strict:true` for CI), `sync_devices` (devices.txt from the portal with the API key), `lint` (SwiftLint / SwiftFormat), and `bump_version` in the generated Fastfile (`iq_bump_version`). `tests/lanes.sh` tests them with stubs; `tests/smoke.sh` runs `bump_version` for real.
- `setup.sh` installs the Ruby even when Homebrew's `ruby-build` is too old to know it (falls back to upstream `ruby-build` as an rbenv plugin); found by the first run on a fresh hosted runner.
- `scripts/doctor.sh` warns when the locale is not UTF-8 (fastlane crashes with "invalid byte sequence in US-ASCII" when run directly; `build.sh` sets it itself). `tests/smoke.sh` now behaves like a developer shell (UTF-8, rbenv active) and is run locally in a clean environment (`env -i`) to catch assumptions about the machine.
- Build-only runs write empty but well-formed junit / Cobertura files (a 0 byte file can make the Jenkins plugins fail to parse it). The build log is found by whatever name fastlane gave it, Jenkins job names are sanitized before they go into the simulator name, and an empty `ASC_KEY_ID` / `ASC_ISSUER_ID` (unset CI secret) no longer overrides the Fastfile values.
- `build.sh` gives fastlane's `xcodebuild -showBuildSettings` 30 seconds instead of 3 (`FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT` to change it): it timed out on a busy machine and the lane died before running anything.
- `setup_match.sh`: fixed inverted check that tried to re-import the common Fastfile when already present.

## 1.x

See git history (`renew_certs` lane added Nov 2026).
Loading
Loading