Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into feature/experimenta…
Browse files Browse the repository at this point in the history
…l-begone
  • Loading branch information
andybak committed Mar 5, 2024
2 parents f248b7b + 7b1aa76 commit b6d1561
Show file tree
Hide file tree
Showing 13 changed files with 132 additions and 52 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
github: icosa-foundation
open_collective: icosa
84 changes: 46 additions & 38 deletions .github/workflows/build.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/delete_branch_cache.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# yamllint disable rule:line-length
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
---
# Taken from https://github.com/actions/cache/blob/main/tips-and-workarounds.md#force-deletion-of-caches-overriding-default-cache-eviction-policy
name: cleanup caches by a branch
on: # yamllint disable-line rule:truthy
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/export_secrets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
# yamllint disable rule:line-length
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Backup secrets (to OpenSSL encrypted file)
on: # yamllint disable-line rule:truthy
workflow_dispatch:

jobs:
backup_secrets:
runs-on: ubuntu-latest
steps:
- name: Backup secrets
env:
SECRETS: ${{ toJSON(secrets) }}
VARS: ${{ toJSON(vars) }}
OPENSSL_ITER: 1000
OPENSSL_PASS: ${{ secrets.SECRET_EXPORT_OPENSSL_PASSWORD }}
run: |
echo "$SECRETS" | tee secrets.txt
echo "$VARS" | tee vars.txt
openssl enc -aes-256-cbc -md sha512 -pbkdf2 -iter $OPENSSL_ITER -salt -in secrets.txt -out secrets.enc.txt -pass pass:$OPENSSL_PASS
openssl enc -aes-256-cbc -md sha512 -pbkdf2 -iter $OPENSSL_ITER -salt -in vars.txt -out vars.enc.txt -pass pass:$OPENSSL_PASS
echo "To decrypt the secrets, use the following command(s):"
echo "openssl enc -aes-256-cbc -d -md sha512 -pbkdf2 -iter $OPENSSL_ITER -salt -in secrets.enc.txt -out secrets.txt -pass pass:<your_password>"
echo "openssl enc -aes-256-cbc -d -md sha512 -pbkdf2 -iter $OPENSSL_ITER -salt -in vars.enc.txt -out vars.txt -pass pass:<your_password>"
- name: Upload encrypted secrets
uses: actions/upload-artifact@v4
with:
name: exports
path: |
secrets.enc.txt
vars.enc.txt
16 changes: 13 additions & 3 deletions .github/workflows/generate_certs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
# yamllint disable rule:line-length
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Generate iOS Certs

on:
on: # yamllint disable-line rule:truthy
workflow_run:
workflows: ['iOS One-Time Setup']
types:
Expand All @@ -9,9 +12,16 @@ on:

jobs:
generate_certs:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
Gemfile
Gemfile.lock
fastlane
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
Expand All @@ -28,9 +38,9 @@ jobs:
APPSTORE_KEY_ID: ${{ secrets.APPSTORE_KEY_ID }}
APPSTORE_P8: ${{ secrets.APPSTORE_P8 }}

IOS_BUNDLE_ID: ${{ secrets.IOS_BUNDLE_ID }}
IOS_BUNDLE_ID: ${{ vars.IOS_ZAPBOX_BUNDLE_ID }}

GH_PAT: ${{ secrets.GH_PAT }}
GH_PAT: ${{ secrets.MATCH_PAT }}
GITHUB_REPOSITORY: ${{ env.GITHUB_REPOSITORY }}
MATCH_REPOSITORY: ${{ secrets.MATCH_REPOSITORY }}
MATCH_DEPLOY_KEY: ${{ secrets.MATCH_DEPLOY_KEY }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/get_license.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Acquire activation file
on:
workflow_dispatch:
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/ios_setup.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
# yamllint disable rule:line-length
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: iOS One-Time Setup

on: workflow_dispatch
Expand All @@ -7,11 +10,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
Gemfile
Gemfile.lock
fastlane
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true

# Note that this job cannot be rerun because of https://github.com/joshdholtz/fastlane-plugin-github_action/issues/4
- name: Build iOS
shell: bash
run: |
Expand All @@ -21,6 +31,6 @@ jobs:
APPSTORE_KEY_ID: ${{ secrets.APPSTORE_KEY_ID }}
APPSTORE_P8: ${{ secrets.APPSTORE_P8 }}

GH_PAT: ${{ secrets.GH_PAT }}
GH_PAT: ${{ secrets.MATCH_PAT }}
GITHUB_REPOSITORY: ${{ env.GITHUB_REPOSITORY }}
MATCH_REPOSITORY: ${{ secrets.MATCH_REPOSITORY }}
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# yamllint disable rule:line-length
---
# yamllint disable rule:line-length
name: pre-commit

on: # yamllint disable-line rule:truthy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_unity_credentials.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# yamllint disable rule:line-length
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
---
name: Test Unity Credentials
on:
workflow_dispatch:
Expand Down
9 changes: 8 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,21 @@ repos:
args:
- --load-plugins=pylint.extensions.redefined_variable_type,pylint.extensions.bad_builtin
- --disable=import-error
- repo: https://github.com/google/yamlfmt
rev: v0.11.0
hooks:
- id: yamlfmt
args:
- -conf
- .yamlfmt
- repo: local
hooks:
# Use dotnet format already installed on your machine
- id: dotnet-format
name: dotnet-format
language: system
entry: dotnet format whitespace
types_or: ["c#", "vb"]
types_or: [c#, vb]
exclude: ^(Assets/ThirdParty)|(Packages/)|(Assets/Photon/)
args:
- --folder
Expand Down
6 changes: 6 additions & 0 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
formatter:
include_document_start: true
indent: 2
retain_line_breaks_single: true
pad_line_comments: 2
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PlayerSettings:
AndroidFilterTouchesWhenObscured: 0
AndroidEnableSustainedPerformanceMode: 0
defaultScreenOrientation: 3
targetDevice: 2
targetDevice: 0
useOnDemandResources: 0
accelerometerFrequency: 100
companyName: Icosa Foundation
Expand Down
14 changes: 9 additions & 5 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ platform :ios do
desc "Deliver a new Release build to the App Store"
lane :release do
build
upload_to_app_store
upload_to_app_store(
force: true,
automatic_release: false,
precheck_include_in_app_purchases: false
)
end

desc "Deliver a new Beta build to Apple TestFlight"
lane :beta do
# Missing Export Compliance can also be set through Deliverfile
update_info_plist(
xcodeproj: "#{ENV['IOS_BUILD_PATH']}/iOS/Unity-iPhone.xcodeproj",
xcodeproj: "#{ENV['IOS_BUILD_PATH']}/Unity-iPhone.xcodeproj",
plist_path: 'Info.plist',
block: proc do |plist|
plist['ITSAppUsesNonExemptEncryption'] = false
Expand All @@ -59,21 +63,21 @@ platform :ios do
# See https://github.com/fastlane/fastlane/discussions/17458 for context
update_code_signing_settings(
use_automatic_signing: true,
path: "#{ENV['IOS_BUILD_PATH']}/iOS/Unity-iPhone.xcodeproj"
path: "#{ENV['IOS_BUILD_PATH']}/Unity-iPhone.xcodeproj"
)

update_code_signing_settings(
use_automatic_signing: false,
team_id: ENV["sigh_#{ENV['IOS_BUNDLE_ID']}_appstore_team-id"],
code_sign_identity: 'iPhone Distribution',
targets: 'Unity-iPhone',
path: "#{ENV['IOS_BUILD_PATH']}/iOS/Unity-iPhone.xcodeproj",
path: "#{ENV['IOS_BUILD_PATH']}/Unity-iPhone.xcodeproj",
profile_name: ENV["sigh_#{ENV['IOS_BUNDLE_ID']}_appstore_profile-name"],
profile_uuid: ENV["sigh_#{ENV['IOS_BUNDLE_ID']}_appstore"]
)

build_app( #alias: gym
project: "#{ENV['IOS_BUILD_PATH']}/iOS/Unity-iPhone.xcodeproj",
project: "#{ENV['IOS_BUILD_PATH']}/Unity-iPhone.xcodeproj",
scheme: 'Unity-iPhone',
xcargs: '-allowProvisioningUpdates'
)
Expand Down

0 comments on commit b6d1561

Please sign in to comment.