Skip to content

Commit

Permalink
🚚 organize files into separate folders
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardodino committed Jul 8, 2022
1 parent d323a3b commit a517e8b
Show file tree
Hide file tree
Showing 29 changed files with 89 additions and 36 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ jobs:
runs-on: macos-12
steps:
- name: Select Xcode Version
run: sudo xcrun xcode-select -s /Applications/Xcode_13.4.app
run: sudo xcrun xcode-select -s /Applications/Xcode_13.4.1.app

- name: Set Environment Variables
run: 'echo "XCARCHIVE_PATH=${PWD}/BeezyLight.xcarchive" >> $GITHUB_ENV'
run: |
APP_NAME="BeezyLight"
echo "APP_NAME=${APP_NAME}" >> $GITHUB_ENV
echo "XCARCHIVE_PATH=${PWD}/${APP_NAME}.xcarchive" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -24,7 +27,7 @@ jobs:
- name: Upload Archive to Artifacts
uses: actions/upload-artifact@v3
with:
name: BeezyLight.xcarchive
name: ${{ env.APP_NAME }}.xcarchive
path: ${{ env.XCARCHIVE_PATH }}
if-no-files-found: error

Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
name: Release

on:
create: { tags: ['v[0-9]+.[0-9]+.[0-9]+'] }
push: { tags: ['v[0-9]+.[0-9]+.[0-9]+'] }

jobs:
release:
name: Xcode Build (Release)
runs-on: macos-12
steps:
- name: Select Xcode Version
run: sudo xcrun xcode-select -s /Applications/Xcode_13.4.app
run: sudo xcrun xcode-select -s /Applications/Xcode_13.4.1.app

- name: Set Environment Variables
run: |
APP_NAME="BeezyLight"
echo "APP_NAME=${APP_NAME}" >> $GITHUB_ENV
echo "XCARCHIVE_PATH=${PWD}/${APP_NAME}.xcarchive" >> $GITHUB_ENV
echo "APP_PATH=${PWD}/${APP_NAME}.xcarchive/Products/Applications/${APP_NAME}.app" >> $GITHUB_ENV
Expand Down Expand Up @@ -83,14 +84,14 @@ jobs:
- name: Upload App to Artifacts
uses: actions/upload-artifact@v3
with:
name: BeezyLight
name: ${{ env.APP_NAME }}
path: ${{ env.ZIP_PATH }}
if-no-files-found: error

- name: Upload Archive to Artifacts
uses: actions/upload-artifact@v3
with:
name: BeezyLight.xcarchive
name: ${{ env.APP_NAME }}.xcarchive
path: ${{ env.XCARCHIVE_PATH }}
if-no-files-found: error

Expand All @@ -115,7 +116,7 @@ jobs:
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.ZIP_PATH }}
asset_name: BeezyLight.zip
asset_name: ${{ env.APP_NAME }}.zip
asset_content_type: application/zip

- name: Publish Release
Expand Down
File renamed without changes.
76 changes: 54 additions & 22 deletions BeezyLight.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@
/* Begin PBXFileReference section */
961F0D2F286F9F8400D35EB3 /* Default.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Default.xcconfig; sourceTree = "<group>"; };
962377FD27F4ECD8002D718F /* StatusItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusItem.swift; sourceTree = "<group>"; };
96A53DDC27C572B9002DA809 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
96A53DDC27C572B9002DA809 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
96B8901127F4E78D00C39B4A /* AboutWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutWindow.swift; sourceTree = "<group>"; };
96B9AA4828774C1A00175C2A /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
96B9AA4928774C1A00175C2A /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
96B9AA4B28774C3800175C2A /* xcode-build */ = {isa = PBXFileReference; lastKnownFileType = text; path = "xcode-build"; sourceTree = "<group>"; };
96B9AA4C28774C3800175C2A /* generate-release-config */ = {isa = PBXFileReference; lastKnownFileType = text; path = "generate-release-config"; sourceTree = "<group>"; };
96C2A1DE27C5632D00768B18 /* BeezyLight.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BeezyLight.app; sourceTree = BUILT_PRODUCTS_DIR; };
96C2A1E127C5632D00768B18 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96C2A1E527C5632E00768B18 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand All @@ -43,37 +47,65 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
96C2A1D527C5632D00768B18 = {
96B9AA4428774A2100175C2A /* Sources */ = {
isa = PBXGroup;
children = (
96C2A1E027C5632D00768B18 /* BeezyLight */,
96C2A1DF27C5632D00768B18 /* Products */,
96DC603427F0F7D000A5FE00 /* Main.storyboard */,
96C2A1E127C5632D00768B18 /* AppDelegate.swift */,
962377FD27F4ECD8002D718F /* StatusItem.swift */,
96B8901127F4E78D00C39B4A /* AboutWindow.swift */,
96C2A1F327C567C300768B18 /* BlinkStick.swift */,
96D5B44727C57CE300C4FFCA /* Debouncer.swift */,
);
path = Sources;
sourceTree = "<group>";
};
96C2A1DF27C5632D00768B18 /* Products */ = {
96B9AA4528774AE200175C2A /* Config */ = {
isa = PBXGroup;
children = (
96C2A1DE27C5632D00768B18 /* BeezyLight.app */,
96C2A1EA27C5632E00768B18 /* BeezyLight.entitlements */,
96A53DDC27C572B9002DA809 /* Info.plist */,
961F0D2F286F9F8400D35EB3 /* Default.xcconfig */,
);
name = Products;
path = Config;
sourceTree = "<group>";
};
96C2A1E027C5632D00768B18 /* BeezyLight */ = {
96B9AA4A28774C3800175C2A /* Scripts */ = {
isa = PBXGroup;
children = (
96B9AA4B28774C3800175C2A /* xcode-build */,
96B9AA4C28774C3800175C2A /* generate-release-config */,
);
path = Scripts;
sourceTree = "<group>";
};
96B9AA4D28774C5F00175C2A /* Assets */ = {
isa = PBXGroup;
children = (
96C2A1E127C5632D00768B18 /* AppDelegate.swift */,
962377FD27F4ECD8002D718F /* StatusItem.swift */,
96B8901127F4E78D00C39B4A /* AboutWindow.swift */,
96C2A1F327C567C300768B18 /* BlinkStick.swift */,
96D5B44727C57CE300C4FFCA /* Debouncer.swift */,
96C2A1E527C5632E00768B18 /* Assets.xcassets */,
96C2A1EA27C5632E00768B18 /* BeezyLight.entitlements */,
96A53DDC27C572B9002DA809 /* Info.plist */,
96DC603427F0F7D000A5FE00 /* Main.storyboard */,
961F0D2F286F9F8400D35EB3 /* Default.xcconfig */,
);
path = BeezyLight;
path = Assets;
sourceTree = "<group>";
};
96C2A1D527C5632D00768B18 = {
isa = PBXGroup;
children = (
96B9AA4D28774C5F00175C2A /* Assets */,
96B9AA4528774AE200175C2A /* Config */,
96B9AA4A28774C3800175C2A /* Scripts */,
96B9AA4428774A2100175C2A /* Sources */,
96B9AA4828774C1A00175C2A /* LICENSE */,
96B9AA4928774C1A00175C2A /* README.md */,
96C2A1DF27C5632D00768B18 /* Products */,
);
sourceTree = "<group>";
};
96C2A1DF27C5632D00768B18 /* Products */ = {
isa = PBXGroup;
children = (
96C2A1DE27C5632D00768B18 /* BeezyLight.app */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
Expand Down Expand Up @@ -284,12 +316,12 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = BeezyLight/BeezyLight.entitlements;
CODE_SIGN_ENTITLEMENTS = Config/BeezyLight.entitlements;
COMBINE_HIDPI_IMAGES = YES;
ENABLE_APP_SANDBOX = YES;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = BeezyLight/Info.plist;
INFOPLIST_FILE = Config/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright Β© 2020 Leonardo Dino\nAll rights reserved.";
INFOPLIST_KEY_NSMainStoryboardFile = Main;
Expand All @@ -310,12 +342,12 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = BeezyLight/BeezyLight.entitlements;
CODE_SIGN_ENTITLEMENTS = Config/BeezyLight.entitlements;
COMBINE_HIDPI_IMAGES = YES;
ENABLE_APP_SANDBOX = YES;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = BeezyLight/Info.plist;
INFOPLIST_FILE = Config/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright Β© 2020 Leonardo Dino\nAll rights reserved.";
INFOPLIST_KEY_NSMainStoryboardFile = Main;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [<sub><img src="BeezyLight/Assets.xcassets/AppIcon.appiconset/icon_128x128.png" width="64" height="64" /></sub>](https://github.com/beezylight/BeezyLight/releases/latest/download/BeezyLight.zip)&nbsp;<sup><sup><sup>BeezyLight.app</sup></sup></sup>
# [<sub><img src="Assets/Assets.xcassets/AppIcon.appiconset/icon_128x128.png" width="64" height="64" /></sub>](https://github.com/beezylight/BeezyLight/releases/latest/download/BeezyLight.zip)&nbsp;<sup><sup><sup>BeezyLight.app</sup></sup></sup>

#### ✦&ensp;tiny macOS app to control a [usb-connected light](https://www.blinkstick.com/products/blinkstick-square)
- [x] ✨ no setup, configs, drivers or persistent system changes
Expand All @@ -11,5 +11,4 @@
#### ✦&ensp;install
1. download lastest version [here](https://github.com/beezylight/BeezyLight/releases/latest/download/BeezyLight.zip)
2. unzip and move `BeezyLight.app` to `/Applications`
3. right click (or two-finger tap on trackpad) and select [Open](https://support.apple.com/en-gb/HT202491#:~:text=control-click%20the%20app)
4. add to [Login Items](https://support.apple.com/en-gb/guide/mac-help/mh15189/mac) to launch it automatically every boot
3. (optional) add to [Login Items](https://support.apple.com/en-gb/guide/mac-help/mh15189/mac) to launch it automatically after login in
2 changes: 1 addition & 1 deletion Scripts/generate-release-config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

RELEASE_CONFIG_PATH="${PWD}/BeezyLight/Release.xcconfig"
RELEASE_CONFIG_PATH="${PWD}/Config/Release.xcconfig"

USAGE="Usage:
$(basename "$0") <bundle-id> <marketing-version> <build-version> <development-team>
Expand Down
18 changes: 18 additions & 0 deletions Scripts/get-scheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

if [ -n "$SCHEME" ]; then
echo "$SCHEME"
exit 0
fi

get-scheme-count() {
python3 -c 'import json,sys;print(len(json.load(sys.stdin)["project"]["targets"]))' <<< "$1"
}

get-first-scheme() {
python3 -c 'import json,sys;print(json.load(sys.stdin)["project"]["targets"][0])' <<< "$1"
}

XCODEBUILD_LIST="$(xcodebuild -list -json 2> /dev/null)"
[ "$(get-scheme-count "$XCODEBUILD_LIST")" -eq "1" ] || exit 1
get-first-scheme "$XCODEBUILD_LIST"
4 changes: 2 additions & 2 deletions Scripts/xcode-build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

RELEASE_CONFIG_PATH="${PWD}/BeezyLight/Release.xcconfig"
SCHEME="BeezyLight"
RELEASE_CONFIG_PATH="${PWD}/Config/Release.xcconfig"
SCHEME="$("$(dirname "$0")/get-scheme")"
WORKSPACE="./${SCHEME}.xcodeproj/project.xcworkspace"

USAGE="Usage:\n$(basename "$0") [release|build] [archive-path]"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a517e8b

Please sign in to comment.