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
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on:
pull_request:
branches: [main]
push:
branches: [main]

permissions: {}

concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: macos-latest
permissions:
contents: read
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false

- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1
with:
xcode-version: "16.1"

- name: Build
run: |
xcodebuild build \
-project "Blue Switch.xcodeproj" \
-scheme "Blue Switch" \
-configuration Debug \
CODE_SIGNING_ALLOWED=NO
24 changes: 19 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
# semantic-release needs full history to determine the next version.
fetch-depth: 0
persist-credentials: false

- name: Set up Node.js
Expand All @@ -45,15 +47,25 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
OUTPUT="$(semantic-release --dry-run --no-ci)"
NEW_RELEASE_VERSION=$(echo "$OUTPUT" | grep 'The next release version is' | sed 's/.*is \([0-9.]*\).*/\1/')
if [ -z "$NEW_RELEASE_VERSION" ]; then
NEW_RELEASE_VERSION="0.0.0"
echo "First commit detected, setting initial version to 0.0.0"
# Extract just the version triple to avoid picking up trailing
# punctuation if the log format ever changes slightly.
NEW_RELEASE_VERSION=$(echo "$OUTPUT" \
| grep -oE 'next release version is [0-9]+\.[0-9]+\.[0-9]+' \
| grep -oE '[0-9]+\.[0-9]+\.[0-9]+' \
|| true)
if [ -n "$NEW_RELEASE_VERSION" ]; then
echo "Will release v$NEW_RELEASE_VERSION"
echo "new-release-version=$NEW_RELEASE_VERSION" >> "$GITHUB_OUTPUT"
else
echo "No releasable commits since the last tag; skipping build & release."
fi
echo "new-release-version=$NEW_RELEASE_VERSION" >> "$GITHUB_OUTPUT"

build:
needs: version
# Gate build on a real release version. The previous code defaulted an
# empty extraction to "0.0.0", which then built and tagged a v0.0.0
# release, overwriting tag history.
if: needs.version.outputs.new-release-version != ''
runs-on: macos-latest
permissions:
contents: read
Expand Down Expand Up @@ -117,6 +129,7 @@ jobs:
needs:
- version
- build
if: needs.version.outputs.new-release-version != ''
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -128,6 +141,7 @@ jobs:
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
persist-credentials: false

- name: Download Build Artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
Expand Down
14 changes: 6 additions & 8 deletions Blue Switch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
076AB2102CE9D690004D45F0 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
076AB2132CE9D690004D45F0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
076AB2142CE9D690004D45F0 /* Blue_Switch.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Blue_Switch.entitlements; sourceTree = "<group>"; };
0A00001000000000000000B0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
077473F22CD8426D00571393 /* Blue Switch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Blue Switch.app"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -184,6 +185,7 @@
076AB2122CE9D690004D45F0 /* View */,
076AB2132CE9D690004D45F0 /* Assets.xcassets */,
076AB2142CE9D690004D45F0 /* Blue_Switch.entitlements */,
0A00001000000000000000B0 /* Info.plist */,
);
path = "Blue Switch";
sourceTree = "<group>";
Expand Down Expand Up @@ -439,10 +441,8 @@
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"Blue Switch/Preview Content\"";
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = "Bluetooth is required to connect with nearby devices";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INFOPLIST_KEY_NSLocalNetworkUsageDescription = "Local network access is needed to discover devices";
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = "Blue Switch/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
Expand All @@ -468,10 +468,8 @@
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"Blue Switch/Preview Content\"";
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = "Bluetooth is required to connect with nearby devices";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INFOPLIST_KEY_NSLocalNetworkUsageDescription = "Local network access is needed to discover devices";
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = "Blue Switch/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1610"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "077473F12CD8426D00571393"
BuildableName = "Blue Switch.app"
BlueprintName = "Blue Switch"
ReferencedContainer = "container:Blue Switch.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "077473F12CD8426D00571393"
BuildableName = "Blue Switch.app"
BlueprintName = "Blue Switch"
ReferencedContainer = "container:Blue Switch.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "077473F12CD8426D00571393"
BuildableName = "Blue Switch.app"
BlueprintName = "Blue Switch"
ReferencedContainer = "container:Blue Switch.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Loading
Loading