Repository navigation
77 lines (72 loc) · 3.37 KB
/
Copy pathversion-plan-contract.yml
File metadata and controls
77 lines (72 loc) · 3.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Version plan contract
# The version-numbering rules behind the iOS TestFlight ship (owner directive
# 2026-10-24, AFC-517). scripts/ios-fleet/version-plan.mjs is the pure,
# unit-tested copy of the rules; scripts/ios-fleet/ship-testflight.sh and
# scripts/ios-fleet/asc-api.mjs implement the same rules against App Store
# Connect. This workflow runs the unit test, so a change to the rules cannot
# land untested, AND it runs the client against a stub App Store Connect, so
# the module cannot drift away from the plan the ship actually applies.
#
# It is a workflow of its own on purpose: the workflows that can upload to
# TestFlight are the ship workflows, and a rule change must never travel with
# an edit to one of them. Nothing here reaches App Store Connect, xcodebuild
# or the network: the unit test is pure, the contract test runs the client
# against a loopback stub, and the two syntax checks are parser runs. So it
# is safe to run on every pull request that touches the rules.
on:
pull_request:
paths:
- 'scripts/ios-fleet/version-plan.mjs'
- 'scripts/ios-fleet/version-plan.test.mjs'
- 'scripts/ios-fleet/shared-build.mjs'
- 'scripts/ios-fleet/shared-build.test.mjs'
- 'scripts/ios-fleet/test-shared-build.sh'
- 'scripts/ios-fleet/test-version-plan-contract.mjs'
- 'scripts/ios-fleet/ship-testflight.sh'
- 'scripts/ios-fleet/asc-api.mjs'
push:
branches: [main]
paths:
- 'scripts/ios-fleet/version-plan.mjs'
- 'scripts/ios-fleet/version-plan.test.mjs'
- 'scripts/ios-fleet/shared-build.mjs'
- 'scripts/ios-fleet/shared-build.test.mjs'
- 'scripts/ios-fleet/test-shared-build.sh'
- 'scripts/ios-fleet/test-version-plan-contract.mjs'
- 'scripts/ios-fleet/ship-testflight.sh'
- 'scripts/ios-fleet/asc-api.mjs'
workflow_dispatch:
concurrency:
group: version-plan-contract-${{ github.ref }}
# Only a pull request's superseded run is cancelled. A push to main is queued,
# so every merge commit keeps its own finished check.
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
rules:
name: Version numbering rules
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Version-numbering rules (AFC-517)
run: |
node --check scripts/ios-fleet/version-plan.mjs
node --check scripts/ios-fleet/asc-api.mjs
bash -n scripts/ios-fleet/ship-testflight.sh
node --test scripts/ios-fleet/version-plan.test.mjs
- name: Fleet shared merge-timestamp build (offline)
run: |
node --test scripts/ios-fleet/shared-build.test.mjs
bash scripts/ios-fleet/test-shared-build.sh
- name: The version plan the ship actually applies (AFC-517)
run: |
# The rules the ship applies live in the client and the ship
# script, so the module is held to what the REAL client answers
# against a stub App Store Connect (ASC_API_BASE). Without this,
# the module and the ship can drift apart -- which they did: the
# module computed "highest patch used + 1" while the client
# computed the next free patch -- while this workflow stayed
# green.
node --test scripts/ios-fleet/test-version-plan-contract.mjs