Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jdee committed Jun 15, 2021
0 parents commit 7ea8069
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/actions/import-release/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Import snapshot
description: Imports a snapshot of the main iOS repo
inputs:
tag:
required: true
description: A tag from the main iOS repo to import
outputs:
sha:
description: The sha for the generated commit in this repo
value: ${{ steps.import-code.outputs.sha }}

runs:
using: composite
steps:
- name: Configure git
id: configure-git
shell: bash
run: |
git config user.name 'Branch SDK Team'
git config user.email [email protected]
- name: Import code
id: import-code
shell: bash
run: |
# clear out the entire repo. * matches everything but .*
git rm -fr *
# cannot git rm -fr .* because of ., .., .git, .ios-spm
# remove specific paths
[[ -d .swiftpm ]] && git rm -fr .swiftpm
[[ -f .cocoadocs ]] && git rm -f .cocoadocs
[[ -f .gitignore ]] && git rm -f .gitignore
# Now copy in the entire iOS repo
cp -pR .ios-repo/* .ios-repo/.swift* .ios-repo/.cocoa* .
# Scrub out any binaries from early commits
[[ -d carthage-files/output ]] && rm -fr carthage-files/output
# Now ditch the local copy of the iOS repo
rm -fr .ios-repo
# Undo any changes to README.md in this repo
# (the original is nearly blank anyway)
git reset HEAD README.md
git checkout -- README.md
# Add everything again. This results in many unchanged files
# and only records what's changed since the last commit (release).
# This effectively squashes together all commits between releases.
git add .
git commit -a -m'[release] ${{ inputs.tag }}'
git push
echo "::set-output name=sha::$(git rev-parse HEAD)"
41 changes: 41 additions & 0 deletions .github/workflows/import.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Import release

on:
workflow_dispatch:
inputs:
tag:
required: true
description: A release tag from the iOS repo to import

jobs:
import:
runs-on: macos-latest
steps:
- name: Check out SPM repo
uses: actions/checkout@v2
- name: Check out main iOS repo
uses: actions/checkout@v2
with:
repository: BranchMetrics/ios-branch-deep-linking-attribution
ref: ${{ github.event.inputs.tag }}
path: .ios-repo
- name: Import release ${{ github.event.inputs.tag }}
id: import-release
uses: ./.github/actions/import-release
with:
tag: ${{ github.event.inputs.tag }}
- name: Create release
uses: actions/github-script@v4
with:
result-encoding: string
script: |
const tag = '${{ github.event.inputs.tag }}';
const sha = '${{ steps.import-release.outputs.sha }}';
await github.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
target_commitish: sha,
tag_name: tag,
name: tag,
body: `Mirror of https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases/${tag}`,
});
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Swift Package Manager repository for iOS

_Work in progress_

This is a mirror of the main [iOS repository](https://github.com/BranchMetrics/ios-branch-deep-linking-attribution)
for use only with Swift Package Manager. It removes binaries and all commit
history before release [0.35.0](https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases/0.35.0),
the first release to support SPM. This greatly improves performance when using
SPM. Releases to the main repo are automatically replicated here with each
tag.

This is for use only with Swift Package Manager. Please use the main repo for
any other purpose.

See https://help.branch.io/developers-hub/docs/ios-sdk-overview for full
documentation of the Branch iOS SDK.

0 comments on commit 7ea8069

Please sign in to comment.