Skip to content

Commit 2e5b55f

Browse files
authored
Enable specifying a tag/branch in the skip-source input for a source build of skip (#14)
* Enable specifying a tag/branch in the skip-source input for a source build of skip * Ensure we install swiftly even when building skip from source * Update actions * Update actions * Add back debug logging for skip export * Update actions * Update actions * Update actions and runner to use macos-26 * Update to use skip v1
1 parent 9b1380b commit 2e5b55f

5 files changed

Lines changed: 45 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
os: ['macos-latest', 'ubuntu-latest']
13-
brew-source: ['formula', 'cask']
13+
skip-source: ['formula', 'cask', 'main']
1414
runs-on: ${{ matrix.os }}
1515
steps:
1616
- uses: actions/checkout@v6
1717
- uses: ./setup-skip
1818
with:
19-
skip-source: ${{ matrix.brew-source }}
19+
skip-source: ${{ matrix.skip-source }}
2020
- run: skip doctor
2121
- run: skip android sdk install --verbose
2222
- run: skip checkup

.github/workflows/skip-app.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ on:
3333
brew-install:
3434
required: false
3535
type: string
36+
skip-source:
37+
required: false
38+
type: string
3639
run-local-tests:
3740
required: false
3841
type: boolean
@@ -54,14 +57,15 @@ on:
5457
required: false
5558
jobs:
5659
skip-app:
57-
runs-on: macos-15-intel
60+
runs-on: macos-26
5861
timeout-minutes: 180
59-
env:
60-
DEVELOPER_DIR: /Applications/Xcode_26.3.app/Contents/Developer
6162
steps:
6263
- uses: actions/checkout@v6
6364
with:
6465
submodules: 'recursive'
66+
# need to fetch tags to be able to update the version in Skip.env
67+
fetch-tags: true
68+
fetch-depth: 0
6569

6670
- name: "Setup"
6771
id: setup
@@ -109,19 +113,32 @@ jobs:
109113
- uses: skiptools/actions/setup-skip@v1
110114
with:
111115
verify-project: '.'
116+
skip-source: '${{ inputs.skip-source }}'
112117
install-swift-android-sdk: ${{ steps.setup.outputs.skip-fuse }}
113118

114119
- name: "Run Tests"
115120
if: ${{ inputs.run-local-tests == true && ! startsWith(github.ref, 'refs/tags/') }}
116121
run: test ! -d Tests || skip test
117122

123+
- name: "Create Android debug keystore"
124+
run: |
125+
if [ ! -f ~/.android/debug.keystore ]; then
126+
mkdir -p ~/.android
127+
keytool -genkeypair -v -keystore ~/.android/debug.keystore \
128+
-alias androiddebugkey -keyalg RSA -keysize 2048 -validity 10000 \
129+
-storepass android -keypass android \
130+
-dname "CN=Android Debug,O=Android,C=US"
131+
fi
132+
118133
- name: "Export project"
119134
run: |
120-
# need to run twice due to a bug with debug key availability
121-
skip export -v --debug -d skip-export --show-tree --summary-file=$GITHUB_STEP_SUMMARY
122-
skip export -v --release -d skip-export --show-tree --summary-file=$GITHUB_STEP_SUMMARY
135+
skip export -d skip-export --verbose --release --appindex --show-tree --summary-file=$GITHUB_STEP_SUMMARY
123136
cp -a Package.resolved skip-export/
124137
138+
- name: "Validate appindex.json"
139+
run: |
140+
cat skip-export/appindex.json | jq .
141+
125142
- name: "Setup Android App Signing"
126143
if: ${{ env.KEYSTORE_PROPERTIES != '' }}
127144
env:

.github/workflows/skip-framework.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ on:
3939
brew-install:
4040
required: false
4141
type: string
42+
skip-source:
43+
required: false
44+
type: string
4245
install-swift:
4346
required: false
4447
type: string
@@ -183,6 +186,7 @@ jobs:
183186
- uses: skiptools/actions/setup-skip@v1
184187
with:
185188
verify-project: '.'
189+
skip-source: '${{ inputs.skip-source }}'
186190
install-swift-android-sdk: ${{ steps.setup.outputs.skip-fuse }}
187191

188192
- name: Install Prerequisities

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ steps:
3131
| Input | Description | Default |
3232
|-------|-------------|---------|
3333
| `skip-version` | Version of the Skip toolchain to install | `'latest'` |
34-
| `skip-source` | Homebrew source to install Skip from ([`formula`](https://formulae.brew.sh/formula/skip) or [`cask`](https://github.com/skiptools/homebrew-skip/blob/main/Casks/skip.rb)) | `'formula'` |
34+
| `skip-source` | Homebrew source to install Skip from ([`formula`](https://formulae.brew.sh/formula/skip) or [`cask`](https://github.com/skiptools/homebrew-skip/blob/main/Casks/skip.rb)) or the branch name to build from source | `'formula'` |
3535
| `run-doctor` | Run `skip doctor` after setup to verify the environment | `'true'` |
3636
| `verify-project` | Path to a project directory to verify with `skip verify` | `''` (disabled) |
3737
| `swift-version` | Swift toolchain version to install via `swiftly` | `''` (use pre-installed) |

setup-skip/action.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@ branding:
55
color: 'blue'
66

77
inputs:
8-
skip-version:
9-
description: 'The version of the Skip toolchain to install'
10-
required: false
11-
default: 'latest'
128
skip-source:
13-
description: 'The Homebrew source to install skip from (formula or cask)'
9+
description: 'The Homebrew source to install skip from (formula or cask or branch name)'
1410
required: false
1511
default: 'formula'
1612
run-doctor:
@@ -66,11 +62,22 @@ runs:
6662
# whether to install the canonical "skip" formula
6763
# or the skiptools cask tap version of the tool
6864
#export HOMEBREW_NO_AUTO_UPDATE=1
69-
if [[ "${{ inputs.skip-source }}" == "formula" ]]; then
65+
if [[ "${{ inputs.skip-source }}" == "formula" || "${{ inputs.skip-source }}" == "" ]]; then
7066
brew install skip
71-
else
67+
elif [[ "${{ inputs.skip-source }}" == "cask" ]]; then
7268
brew tap skiptools/skip
7369
brew install skiptools/skip/skip
70+
else
71+
# otherwise checkout and build the branch name in skip-source
72+
cd ${TMPDIR}
73+
git clone --recurse-submodules --branch "${{ inputs.skip-source }}" https://github.com/skiptools/skipstone.git
74+
swift build --package-path skipstone/
75+
mv skipstone/.build/debug/SkipRunner skipstone/.build/debug/skip
76+
SKIPPATH="${PWD}/skipstone/.build/debug"
77+
echo "${SKIPPATH}" >> $GITHUB_PATH
78+
echo "SKIP_COMMAND_OVERRIDE=${SKIPPATH}/skip" >> $GITHUB_ENV
79+
cd -
80+
${SKIPPATH}/skip version
7481
fi
7582
7683
if [ ${RUNNER_OS} == 'macOS' ]; then
@@ -99,7 +106,7 @@ runs:
99106
100107
- name: Initialize swiftly
101108
shell: bash
102-
run: swiftly init --skip-install --assume-yes
109+
run: brew install swiftly && swiftly init --skip-install --assume-yes
103110

104111
- name: Install Host Swift Toolchain
105112
if: ${{ inputs.swift-version != '' }}

0 commit comments

Comments
 (0)