Skip to content

Commit

Permalink
feat: 🎸 first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tomokisun committed Dec 24, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
0 parents commit a351a8e
Showing 507 changed files with 21,793 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BeMatch:
- any: ['Packages/BeMatch/**', 'App/BeMatch/**', ]

FlyCam:
- any: ['Packages/FlyCam/**', 'App/FlyCam/**',]

SDK:
- any: ['Packages/SDK/**']
14 changes: 14 additions & 0 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Auto Approve

on:
pull_request

jobs:
auto-approve:
runs-on: ubuntu-latest
steps:
- run: gh pr review --approve "$PR_URL"
if: github.actor == 'tomokisun' || github.actor == 'ren-suke' || github.actor == 'renovate[bot]'
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/bematch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: BeMatch

on:
workflow_dispatch:
push:
branches:
- main
paths:
- App/BeMatch/**/*
- Packages/BeMatch/**/*
- Packages/SDK/**/*
- .github/workflows/bematch.yml
- Makefile
pull_request:
paths:
- App/BeMatch/**/*
- Packages/BeMatch/**/*
- Packages/SDK/**/*
- .github/workflows/bematch.yml
- Makefile

env:
PLATFORM_IOS: iOS Simulator,name=iPhone 15 Pro,OS=17.0.1
BEMATCH_FILE_FIREBASE_STAGING: ${{ secrets.BEMATCH_FILE_FIREBASE_STAGING }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- run: ls /Applications
- run: sudo xcode-select -s /Applications/Xcode_15.0.1.app
- uses: irgaly/xcode-cache@v1
with:
key: bematch-xcode-cache-deriveddata-${{ github.workflow }}-${{ github.sha }}
restore-keys: bematch-xcode-cache-deriveddata-${{ github.workflow }}-
- run: make bootstrap
- run: xcodebuild build -workspace BeMatch.xcworkspace -scheme "App (Staging project)" -skipMacroValidation -destination platform="${{ env.PLATFORM_IOS }}" | xcpretty
42 changes: 42 additions & 0 deletions .github/workflows/flycam.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: FlyCam

on:
workflow_dispatch:
push:
branches:
- main
paths:
- App/FlyCam/**/*
- Packages/FlyCam/**/*
- Packages/SDK/**/*
- .github/workflows/flycam.yml
- Makefile
pull_request:
paths:
- App/FlyCam/**/*
- Packages/FlyCam/**/*
- Packages/SDK/**/*
- .github/workflows/flycam.yml
- Makefile

env:
PLATFORM_IOS: iOS Simulator,name=iPhone 15 Pro,OS=17.0.1
FLYCAM_FILE_FIREBASE_STAGING: ${{ secrets.FLYCAM_FILE_FIREBASE_STAGING }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- run: ls /Applications
- run: sudo xcode-select -s /Applications/Xcode_15.0.1.app
- uses: irgaly/xcode-cache@v1
with:
key: flycam-xcode-cache-deriveddata-${{ github.workflow }}-${{ github.sha }}
restore-keys: flycam-xcode-cache-deriveddata-${{ github.workflow }}-
- run: make bootstrap
- run: xcodebuild build -workspace FlyCam.xcworkspace -scheme "App (Staging project)" -skipMacroValidation -destination platform="${{ env.PLATFORM_IOS }}" | xcpretty
48 changes: 48 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Format

on:
workflow_dispatch:
push:
branches:
- main
paths:
- '**.swift'
- '.github/workflows/format.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
swift-format:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- run: sudo xcode-select -s /Applications/Xcode_15.0.1.app
- run: defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES
- uses: actions/cache@v3
with:
path: BuildTools/SwiftFormatTool/.build
key: ${{ runner.os }}-SwiftFormatTool-${{ hashFiles('BuildTools/SwiftFormatTool/Package.resolved') }}
- run: swift build -c release --package-path ./BuildTools/SwiftFormatTool --product swiftformat
- run: ./BuildTools/SwiftFormatTool/.build/release/swiftformat ./
- continue-on-error: true
uses: peter-evans/create-pull-request@v5
id: create-pr
with:
delete-branch: true
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
committer: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
branch-suffix: short-commit-hash
commit-message: "refactor: 💡 swift-format"
title: Run swift-format
- continue-on-error: true
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ steps.create-pr.outputs.pull-request-url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- continue-on-error: true
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ steps.create-pr.outputs.pull-request-url }}
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
152 changes: 152 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
name: Release

on:
workflow_dispatch:
inputs:
project:
description: 'Select Project'
required: true
type: choice
options:
- BeMatch
- FlyCam
version:
description: 'CFBundleShortVersionString'
required: true

jobs:
bematch:
runs-on: macOS-latest
if: ${{ inputs.project == 'BeMatch' }}
steps:
- uses: actions/checkout@v4
- name: Current Version
id: current-version
run: echo "CURRENT_VERSION=$(defaults read $(pwd)/App/BeMatch/Multiplatform/Staging/Info CFBundleShortVersionString)" >> $GITHUB_OUTPUT
- run: |
sed -i '' "s/${{ steps.current-version.outputs.CURRENT_VERSION }}/${{ github.event.inputs.version }}/g" App/BeMatch/Multiplatform/Staging/Info.plist
sed -i '' "s/${{ steps.current-version.outputs.CURRENT_VERSION }}/${{ github.event.inputs.version }}/g" App/BeMatch/Multiplatform/Production/Info.plist
- continue-on-error: true
uses: peter-evans/create-pull-request@v5
id: create-pr
with:
delete-branch: true
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
committer: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
branch-suffix: short-commit-hash
commit-message: "Bump BeMatch from ${{ steps.current-version.outputs.CURRENT_VERSION }} to ${{ github.event.inputs.version }}"
title: "Bump BeMatch from ${{ steps.current-version.outputs.CURRENT_VERSION }} to ${{ github.event.inputs.version }}"
- continue-on-error: true
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ steps.create-pr.outputs.pull-request-url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- continue-on-error: true
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ steps.create-pr.outputs.pull-request-url }}
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}

flycam:
runs-on: macOS-latest
if: ${{ inputs.project == 'FlyCam' }}
steps:
- uses: actions/checkout@v4
- name: Current Version
id: current-version
run: echo "CURRENT_VERSION=$(defaults read $(pwd)/App/FlyCam/Multiplatform/Staging/Info CFBundleShortVersionString)" >> $GITHUB_OUTPUT
- run: |
sed -i '' "s/${{ steps.current-version.outputs.CURRENT_VERSION }}/${{ github.event.inputs.version }}/g" App/FlyCam/Multiplatform/Staging/Info.plist
sed -i '' "s/${{ steps.current-version.outputs.CURRENT_VERSION }}/${{ github.event.inputs.version }}/g" App/FlyCam/Multiplatform/Production/Info.plist
- continue-on-error: true
uses: peter-evans/create-pull-request@v5
id: create-pr
with:
delete-branch: true
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
committer: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
branch-suffix: short-commit-hash
commit-message: "Bump FlyCam from ${{ steps.current-version.outputs.CURRENT_VERSION }} to ${{ github.event.inputs.version }}"
title: "Bump FlyCam from ${{ steps.current-version.outputs.CURRENT_VERSION }} to ${{ github.event.inputs.version }}"
- continue-on-error: true
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ steps.create-pr.outputs.pull-request-url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- continue-on-error: true
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ steps.create-pr.outputs.pull-request-url }}
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}

create-release-bematch:
runs-on: ubuntu-latest
needs: bematch
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TZ: 'Asia/Tokyo'
steps:
- uses: actions/checkout@v4
- name: Get previous tag
id: pre_tag
run: |
echo "::set-output name=pre_tag::$(curl -H 'Accept: application/vnd.github.v3+json' -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)"
- name: Generate release tag
id: release_tag
run: |
pre_release_date=$(echo ${{ steps.pre_tag.outputs.pre_tag }} | awk -F'-' '{print $1}')
pre_release_count=$(echo ${{ steps.pre_tag.outputs.pre_tag }} | awk -F'-' '{print $2}')
if [[ ! $pre_release_date = ${{ github.event.inputs.version }} ]]; then
echo "init count"
pre_release_count=0
fi
echo "::set-output name=release_tag::BeMatch-${{ github.event.inputs.version }}"
- name: Generate release note
id: release_note
run: |
echo "::set-output name=release_note::$(curl -X POST -H 'Accept: application/vnd.github.v3+json' -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/${{ github.repository }}/releases/generate-notes -d '{"tag_name":"${{ steps.release_tag.outputs.release_tag }}", "previous_tag_name":"${{ steps.pre_tag.outputs.pre_tag }}"}' | jq .body | sed 's/"//g')"
- name: Create Release
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-d "{ \"tag_name\": \"${{ steps.release_tag.outputs.release_tag }}\", \"name\": \"${{ steps.release_tag.outputs.release_tag }}\", \"body\": \"${{ steps.release_note.outputs.release_note }}\"}" \
https://api.github.com/repos/${{ github.repository }}/releases
create-release-flycam:
runs-on: ubuntu-latest
needs: flycam
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TZ: 'Asia/Tokyo'
steps:
- uses: actions/checkout@v4
- name: Get previous tag
id: pre_tag
run: |
echo "::set-output name=pre_tag::$(curl -H 'Accept: application/vnd.github.v3+json' -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)"
- name: Generate release tag
id: release_tag
run: |
pre_release_date=$(echo ${{ steps.pre_tag.outputs.pre_tag }} | awk -F'-' '{print $1}')
pre_release_count=$(echo ${{ steps.pre_tag.outputs.pre_tag }} | awk -F'-' '{print $2}')
if [[ ! $pre_release_date = ${{ github.event.inputs.version }} ]]; then
echo "init count"
pre_release_count=0
fi
echo "::set-output name=release_tag::FlyCam-${{ github.event.inputs.version }}"
- name: Generate release note
id: release_note
run: |
echo "::set-output name=release_note::$(curl -X POST -H 'Accept: application/vnd.github.v3+json' -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/${{ github.repository }}/releases/generate-notes -d '{"tag_name":"${{ steps.release_tag.outputs.release_tag }}", "previous_tag_name":"${{ steps.pre_tag.outputs.pre_tag }}"}' | jq .body | sed 's/"//g')"
- name: Create Release
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-d "{ \"tag_name\": \"${{ steps.release_tag.outputs.release_tag }}\", \"name\": \"${{ steps.release_tag.outputs.release_tag }}\", \"body\": \"${{ steps.release_note.outputs.release_note }}\"}" \
https://api.github.com/repos/${{ github.repository }}/releases
30 changes: 30 additions & 0 deletions .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Renovate

on:
push:
branches:
- 'renovate/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
update:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- run: sudo xcode-select -s /Applications/Xcode_15.0.1.app
- run: defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES
- run: xcodebuild -workspace BeMatch.xcworkspace -resolvePackageDependencies -scheme "App (Staging project)" -skipMacroValidation
- run: xcodebuild -workspace FlyCam.xcworkspace -resolvePackageDependencies -scheme "App (Staging project)" -skipMacroValidation
- run: xcodebuild -workspace SDK.xcworkspace -resolvePackageDependencies -scheme "AllLibrary" -skipMacroValidation
- run: swift build -c release --package-path ./BuildTools/ApolloTool
- run: swift build -c release --package-path ./BuildTools/DependenciesGraph --product dgraph
- run: swift build -c release --package-path ./BuildTools/SwiftFormatTool --product swiftformat
- run: swift build -c release --package-path ./BuildTools/XCTemplateInstallerTool --product XCTemplateInstaller
- continue-on-error: true
run: |
git config --local user.name 'github-actions[bot]'
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
git commit -am "chore: 🤖 update package.resolved"
git push
6 changes: 6 additions & 0 deletions .github/workflows/scripts/auto-update-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

NEW_VERSION=$(date '+%y').$(date '+%m').$(date '+%d')
CURRENT_VERSION=$(defaults read $(pwd)/App/Multiplatform/Info CFBundleShortVersionString)

sed -i '' "s/$CURRENT_VERSION/$NEW_VERSION/g" App/Multiplatform/Info.plist
35 changes: 35 additions & 0 deletions .github/workflows/sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: SDK

on:
workflow_dispatch:
push:
branches:
- main
paths:
- Packages/SDK/**/*
- .github/workflows/sdk.yml
pull_request:
paths:
- Packages/SDK/**/*
- .github/workflows/sdk.yml

env:
PLATFORM_IOS: iOS Simulator,name=iPhone 15 Pro,OS=17.0.1

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- run: ls /Applications
- run: sudo xcode-select -s /Applications/Xcode_15.0.1.app
- uses: irgaly/xcode-cache@v1
with:
key: sdk-xcode-cache-deriveddata-${{ github.workflow }}-${{ github.sha }}
restore-keys: sdk-xcode-cache-deriveddata-${{ github.workflow }}-
- run: make bootstrap
- run: xcodebuild build -workspace SDK.xcworkspace -scheme "AllLibrary" -skipMacroValidation -sdk iphonesimulator | xcpretty
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.DS_Store
**/.build
/*.xcodeproj
xcuserdata/
DerivedData/
.swiftpm/config/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
**/*/Secrets.swift
**/*/GoogleService-Info.plist
SourcePackages
**/*/apollo-ios-cli
Loading

0 comments on commit a351a8e

Please sign in to comment.