Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
rickirby committed Dec 31, 2023
2 parents 30eb027 + 4714f62 commit 4b49a8b
Show file tree
Hide file tree
Showing 30 changed files with 1,072 additions and 4 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/build_firebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This workflow will build a Swift project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift

name: Build Firebase

on:
workflow_dispatch:

jobs:
build_firebase:
name: Build Firebase
runs-on: macos-latest

steps:
- name: Xcode Select Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.1'

- name: Checkout Branch
uses: actions/checkout@v2

- name: Install Bundle Dependency
run: |
bundle install
- name: Install XcodeGen
run: |
brew install xcodegen
- name: Build IPA and Upload to Firebase using Fastlane
env:
FIREBASE_APP_ID: ${{ vars.FIREBASE_APP_ID }}
FIREBASE_TOKEN: ${{ vars.FIREBASE_TOKEN }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{ vars.MATCH_GIT_BASIC_AUTHORIZATION }}
MATCH_KEYCHAIN: ${{ vars.MATCH_KEYCHAIN }}
MATCH_PASSWORD: ${{ vars.MATCH_PASSWORD }}
DISCORD_WEBHOOK_URL: ${{ vars.DISCORD_WEBHOOK_URL }}
BUILD_NUMBER: ${{ github.run_number }}
WORKFLOW_NAME: ${{ github.workflow }}
BRANCH_NAME: ${{ github.ref_name }}
COMMIT_SHA: ${{ github.sha }}
run: |
bundle exec fastlane build_firebase
47 changes: 47 additions & 0 deletions .github/workflows/build_testflight.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow will build a Swift project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift

name: Build TestFlight

on:
workflow_dispatch:

jobs:
build_testflight:
name: Build TestFlight
runs-on: macos-latest

steps:
- name: Xcode Select Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.1'

- name: Checkout Branch
uses: actions/checkout@v2

- name: Install Bundle Dependency
run: |
bundle install
- name: Install XcodeGen
run: |
brew install xcodegen
- name: Build IPA and Upload to TestFlight using Fastlane
env:
APP_STORE_CONNECT_API_KEY_IN_HOUSE: ${{ vars.APP_STORE_CONNECT_API_KEY_IN_HOUSE }}
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ vars.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}
APP_STORE_CONNECT_API_KEY_IS_KEY_CONTENT_BASE64: ${{ vars.APP_STORE_CONNECT_API_KEY_IS_KEY_CONTENT_BASE64 }}
APP_STORE_CONNECT_API_KEY_KEY: ${{ vars.APP_STORE_CONNECT_API_KEY_KEY }}
APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ vars.APP_STORE_CONNECT_API_KEY_KEY_ID }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{ vars.MATCH_GIT_BASIC_AUTHORIZATION }}
MATCH_KEYCHAIN: ${{ vars.MATCH_KEYCHAIN }}
MATCH_PASSWORD: ${{ vars.MATCH_PASSWORD }}
DISCORD_WEBHOOK_URL: ${{ vars.DISCORD_WEBHOOK_URL }}
BUILD_NUMBER: ${{ github.run_number }}
WORKFLOW_NAME: ${{ github.workflow }}
BRANCH_NAME: ${{ github.ref_name }}
COMMIT_SHA: ${{ github.sha }}
run: |
bundle exec fastlane build_testflight
38 changes: 38 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Contribution Guidelines

We welcome and appreciate contributions to Scandocs! Whether you want to report a bug, propose a new feature, or submit a fix, your help is invaluable.

## How to Contribute

### Reporting Issues

If you encounter any issues or have suggestions for improvement, please [open an issue](https://github.com/rickirby/scandocs/issues/new) on this repository. Make sure to include:

- A clear and descriptive title.
- Details about the problem or enhancement you are suggesting.
- Steps to reproduce (if applicable).
- Screenshots or code snippets (if relevant).

### Pull Requests

We encourage you to contribute directly by submitting pull requests.

1. Fork the repository to your GitHub account.
2. Clone your fork to your local machine: `git clone https://github.com/your-username/scandocs.git`
3. Create a new branch for your changes: `git checkout -b feature/your-feature` or `git checkout -b bugfix/your-bug-fix`
4. Make your changes and commit: `git commit -m "Description of your changes"`
5. Push the branch to your fork: `git push origin feature/your-feature`
6. Open a pull request (PR) against the `development` branch on this repository.

Please ensure that your pull request:

- Includes a clear title and description of the changes.
- References the related issue (if applicable).
- Follows the coding style and conventions used in the project.
- Has a well-documented code and, if applicable, includes tests.

## License

By contributing to Scandocs, you agree that your contributions will be licensed under the [MIT License](LICENSE).

Thank you for contributing to Scandocs!
4 changes: 3 additions & 1 deletion Configuration/AdHoc.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@

APP_NAME = Scandocs (AdHoc)
BUNDLE_ID = com.scandocs.ios
APP_PROVISIONING_PROFILE = match AdHoc com.scandocs.ios
CODE_SIGN_IDENTITY = Apple Distribution: Ricki Bin Yamin (6NMANHT3A2)
VALIDATE_PRODUCT = NO
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
TARGETED_DEVICE_FAMILY = 1
IPHONEOS_DEPLOYMENT_TARGET = 15.0
BUILD_NUMBER = 1
VERSION_NAME = 1.0.0
CODE_SIGN_STYLE = Automatic
CODE_SIGN_STYLE = Manual
DEVELOPMENT_TEAM = 6NMANHT3A2
SWIFT_OPTIMIZATION_LEVEL = -O
SWIFT_VERSION = 5.0
Expand Down
4 changes: 3 additions & 1 deletion Configuration/Development.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@

APP_NAME = Scandocs (Development)
BUNDLE_ID = com.scandocs.ios
APP_PROVISIONING_PROFILE = match Development com.scandocs.ios
CODE_SIGN_IDENTITY = Apple Development: Ricki Bin Yamin (BWBZZ27H86)
VALIDATE_PRODUCT = NO
DEBUG_INFORMATION_FORMAT = dwarf
TARGETED_DEVICE_FAMILY = 1
IPHONEOS_DEPLOYMENT_TARGET = 15.0
BUILD_NUMBER = 1
VERSION_NAME = 1.0.0
CODE_SIGN_STYLE = Automatic
CODE_SIGN_STYLE = Manual
DEVELOPMENT_TEAM = 6NMANHT3A2
SWIFT_OPTIMIZATION_LEVEL = -Onone
SWIFT_VERSION = 5.0
Expand Down
4 changes: 3 additions & 1 deletion Configuration/Release.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@

APP_NAME = Scandocs
BUNDLE_ID = com.scandocs.ios
APP_PROVISIONING_PROFILE = match AppStore com.scandocs.ios
CODE_SIGN_IDENTITY = Apple Distribution: Ricki Bin Yamin (6NMANHT3A2)
VALIDATE_PRODUCT = YES
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
TARGETED_DEVICE_FAMILY = 1
IPHONEOS_DEPLOYMENT_TARGET = 15.0
BUILD_NUMBER = 1
VERSION_NAME = 1.0.0
CODE_SIGN_STYLE = Automatic
CODE_SIGN_STYLE = Manual
DEVELOPMENT_TEAM = 6NMANHT3A2
SWIFT_OPTIMIZATION_LEVEL = -O
SWIFT_VERSION = 5.0
Expand Down
6 changes: 6 additions & 0 deletions Fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
app_identifier("com.scandocs.ios") # The bundle identifier of your app
apple_id("[email protected]") # Your Apple Developer Portal username


# For more information about the Appfile, see:
# https://docs.fastlane.tools/advanced/#appfile
199 changes: 199 additions & 0 deletions Fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:ios)

platform :ios do

desc "Setup CI Keychain to prevent stack due to default keychain locked"
lane :setupCIKeychain do
create_keychain(
name: ENV["MATCH_KEYCHAIN"],
password: ENV["MATCH_PASSWORD"],
default_keychain: true,
unlock: true,
timeout: 3600,
add_to_search_list: true,
verbose: true
)
end

desc "Preparing Certificate and Provisioning Profiles on New Device Setup"
lane :prepare do
match(
app_identifier: "com.scandocs.ios",
type: "development",
readonly: true
)

match(
app_identifier: "com.scandocs.ios",
type: "adhoc",
readonly: true
)

match(
app_identifier: "com.scandocs.ios",
type: "appstore",
readonly: true
)
end

desc "Build TestFlight"
lane :build_testflight do
build_number = ENV["BUILD_NUMBER"]

UI.message("Change build number to #{build_number}")
sh("cd .. && ./Tooling/change_build_number.sh #{build_number}")

UI.message("Setup Project")
sh("cd .. && ./setup.sh")

UI.message("Setup Custom Keychain")
setupCIKeychain

UI.message("Prepare Provisioning Profiles")
match(
keychain_name: ENV["MATCH_KEYCHAIN"] || "login.keychain",
keychain_password: ENV["MATCH_PASSWORD"] || "",
app_identifier: "com.scandocs.ios",
type: "appstore",
readonly: true
)

UI.message("Build IPA")
build_app(
workspace: "Scandocs.xcworkspace",
scheme: "Scandocs",
configuration: "Release",
export_method: "app-store",
export_options: {
iCloudContainerEnvironment: "Production"
}
)

app_store_connect_api_key

UI.message("Upload to TestFlight")
upload_to_testflight(
skip_waiting_for_build_processing: true,
skip_submission: true
)

notifySuccessBuild(
destination: "TestFlight"
)
end

desc "Build Firebase"
lane :build_firebase do
build_number = ENV["BUILD_NUMBER"]

UI.message("Change build number to #{build_number}")
sh("cd .. && ./Tooling/change_build_number.sh #{build_number}")

UI.message("Setup Project")
sh("cd .. && ./setup.sh")

UI.message("Setup Custom Keychain")
setupCIKeychain

UI.message("Prepare Provisioning Profiles")
match(
keychain_name: ENV["MATCH_KEYCHAIN"] || "login.keychain",
keychain_password: ENV["MATCH_PASSWORD"] || "",
app_identifier: "com.scandocs.ios",
type: "adhoc",
readonly: true
)

UI.message("Build IPA")
build_app(
workspace: "Scandocs.xcworkspace",
scheme: "Scandocs",
configuration: "AdHoc",
export_method: "ad-hoc",
export_options: {
iCloudContainerEnvironment: "Development"
}
)

UI.message("Upload to Firebase")
firebase_app_distribution(
app: ENV["FIREBASE_APP_ID"],
release_notes: ENV["BRANCH_NAME"],
groups: "self-tester",
firebase_cli_token: ENV["FIREBASE_TOKEN"]
)

notifySuccessBuild(
destination: "Firebase"
)
end

desc "Send success message to Discord"
lane :notifySuccessBuild do |options|
destination = options[:destination]

discord_notifier(
webhook_url: ENV["DISCORD_WEBHOOK_URL"],
success: true,
title: "#{destination}",
description: "Apps has been successfully uploaded to #{destination} 🎉",
fields:[
{
name: "Build Number",
value: ENV["BUILD_NUMBER"] || "-"
},
{
name: "Git Branch",
value: ENV["BRANCH_NAME"] || "-"
},
{
name: "Git Commit",
value: ENV["COMMIT_SHA"] || "-"
}
]
)
end

desc "Send error message to Discord"
error do |lane, exception|
discord_notifier(
webhook_url: ENV["DISCORD_WEBHOOK_URL"],
success: false,
title: "Error 💥",
description: "Encountered error from Workflow `#{ENV["GITHUB_WORKFLOW"]}` on lane `#{lane}`.",
fields:[
{
name: "Build Number",
value: ENV["BUILD_NUMBER"] || "local build"
},
{
name: "Git Branch",
value: ENV["BRANCH_NAME"] || "-"
},
{
name: "Git Commit",
value: ENV["COMMIT_SHA"] || "-"
},
{
name: "Error Message",
value: exception
}
]
)
end
end
Loading

0 comments on commit 4b49a8b

Please sign in to comment.