-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from ayroblu/ux-improvements
Fix build + make screenshot open over where it was created
- Loading branch information
Showing
12 changed files
with
296 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: [ macos-latest ] | ||
|
||
steps: | ||
- name: Select latest Xcode | ||
run: "sudo xcode-select -s /Applications/Xcode_13.2.app" | ||
- name: Install the Apple certificate and provisioning profile | ||
env: | ||
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} | ||
P12_PASSWORD: ${{ secrets.P12_PASSWORD }} | ||
# BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }} | ||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | ||
run: | | ||
# create variables | ||
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 | ||
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision | ||
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | ||
# import certificate and provisioning profile from secrets | ||
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH | ||
#echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH | ||
# create temporary keychain | ||
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | ||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | ||
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | ||
# import certificate to keychain | ||
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | ||
security list-keychain -d user -s $KEYCHAIN_PATH | ||
# apply provisioning profile | ||
# mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | ||
# cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles | ||
- name: Install deps | ||
run: | | ||
brew install make create-dmg ripgrep | ||
echo "/usr/local/opt/make/libexec/gnubin" >> $GITHUB_PATH | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/cache@v1 | ||
id: carthage-cache | ||
with: | ||
path: Carthage | ||
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }} | ||
|
||
- name: Carthage | ||
if: steps.carthage-cache.outputs.cache-hit != 'true' | ||
run: | | ||
carthage bootstrap --use-xcframeworks | ||
- name: Build and make dmg | ||
run: | | ||
make dmg | ||
- name: Upload artifacts | ||
uses: actions/[email protected] | ||
with: | ||
name: Fuwari | ||
path: ./dist | ||
|
||
pre-release: | ||
needs: build | ||
runs-on: [ macos-latest ] | ||
if: "!startsWith(github.ref, 'refs/tags/v')" | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: Fuwari | ||
path: ./dist | ||
|
||
- uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: "latest" | ||
prerelease: true | ||
title: "Development Build" | ||
files: | | ||
dist/Fuwari.dmg | ||
release: | ||
needs: build | ||
runs-on: [ macos-latest ] | ||
if: "startsWith(github.ref, 'refs/tags/v')" | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: Fuwari | ||
path: ./dist | ||
|
||
- uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
prerelease: false | ||
files: | | ||
dist/Fuwari.dmg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,3 +65,6 @@ fastlane/report.xml | |
fastlane/Preview.html | ||
fastlane/screenshots | ||
fastlane/test_output | ||
|
||
/dist | ||
/artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
github "Clipy/Magnet" == 3.2.0 | ||
github "Clipy/LoginServiceKit" == 2.2.0 | ||
github "Clipy/LoginServiceKit" == 2.3.0 | ||
github "Clipy/KeyHolder" == 4.0.0 | ||
github "Clipy/Sauce" == 2.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
github "Clipy/KeyHolder" "v4.0.0" | ||
github "Clipy/LoginServiceKit" "v2.2.0" | ||
github "Clipy/LoginServiceKit" "v2.3.0" | ||
github "Clipy/Magnet" "v3.2.0" | ||
github "Clipy/Sauce" "v2.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>method</key> | ||
<string>mac-application</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// Regex.swift | ||
// Fuwari | ||
// | ||
// Created by Ben Lu on 01/03/2022. | ||
// Copyright © 2022 AppKnop. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
struct Regex { | ||
static func match(str: String, regexPattern: String) -> NSTextCheckingResult? { | ||
let strRange = NSRange(str.startIndex..<str.endIndex, in: str) | ||
|
||
let regex = try! NSRegularExpression( | ||
pattern: regexPattern, | ||
options: [] | ||
) | ||
let matches = regex.matches( | ||
in: str, | ||
options: [], | ||
range: strRange | ||
) | ||
|
||
return matches.first | ||
} | ||
|
||
static func getGroup(match: NSTextCheckingResult, name: String, str: String) throws -> String { | ||
let matchRange = match.range(withName: name) | ||
|
||
// Extract the substring matching the named capture group | ||
if let substringRange = Range(matchRange, in: str) { | ||
let capture = String(str[substringRange]) | ||
return capture | ||
} | ||
throw RegexError.missingGroup(name: name) | ||
} | ||
} | ||
|
||
enum RegexError: Error { | ||
case missingGroup(name: String) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.