-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
1,072 additions
and
4 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,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 |
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,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 |
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,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! |
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,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 |
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,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 |
Oops, something went wrong.