Skip to content

Commit 7ea8069

Browse files
committed
initial commit
0 parents  commit 7ea8069

File tree

3 files changed

+112
-0
lines changed

3 files changed

+112
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Import snapshot
2+
description: Imports a snapshot of the main iOS repo
3+
inputs:
4+
tag:
5+
required: true
6+
description: A tag from the main iOS repo to import
7+
outputs:
8+
sha:
9+
description: The sha for the generated commit in this repo
10+
value: ${{ steps.import-code.outputs.sha }}
11+
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Configure git
16+
id: configure-git
17+
shell: bash
18+
run: |
19+
git config user.name 'Branch SDK Team'
20+
git config user.email [email protected]
21+
- name: Import code
22+
id: import-code
23+
shell: bash
24+
run: |
25+
# clear out the entire repo. * matches everything but .*
26+
git rm -fr *
27+
28+
# cannot git rm -fr .* because of ., .., .git, .ios-spm
29+
# remove specific paths
30+
[[ -d .swiftpm ]] && git rm -fr .swiftpm
31+
[[ -f .cocoadocs ]] && git rm -f .cocoadocs
32+
[[ -f .gitignore ]] && git rm -f .gitignore
33+
34+
# Now copy in the entire iOS repo
35+
cp -pR .ios-repo/* .ios-repo/.swift* .ios-repo/.cocoa* .
36+
37+
# Scrub out any binaries from early commits
38+
[[ -d carthage-files/output ]] && rm -fr carthage-files/output
39+
40+
# Now ditch the local copy of the iOS repo
41+
rm -fr .ios-repo
42+
43+
# Undo any changes to README.md in this repo
44+
# (the original is nearly blank anyway)
45+
git reset HEAD README.md
46+
git checkout -- README.md
47+
48+
# Add everything again. This results in many unchanged files
49+
# and only records what's changed since the last commit (release).
50+
# This effectively squashes together all commits between releases.
51+
git add .
52+
git commit -a -m'[release] ${{ inputs.tag }}'
53+
git push
54+
55+
echo "::set-output name=sha::$(git rev-parse HEAD)"

.github/workflows/import.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Import release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
required: true
8+
description: A release tag from the iOS repo to import
9+
10+
jobs:
11+
import:
12+
runs-on: macos-latest
13+
steps:
14+
- name: Check out SPM repo
15+
uses: actions/checkout@v2
16+
- name: Check out main iOS repo
17+
uses: actions/checkout@v2
18+
with:
19+
repository: BranchMetrics/ios-branch-deep-linking-attribution
20+
ref: ${{ github.event.inputs.tag }}
21+
path: .ios-repo
22+
- name: Import release ${{ github.event.inputs.tag }}
23+
id: import-release
24+
uses: ./.github/actions/import-release
25+
with:
26+
tag: ${{ github.event.inputs.tag }}
27+
- name: Create release
28+
uses: actions/github-script@v4
29+
with:
30+
result-encoding: string
31+
script: |
32+
const tag = '${{ github.event.inputs.tag }}';
33+
const sha = '${{ steps.import-release.outputs.sha }}';
34+
await github.repos.createRelease({
35+
owner: context.repo.owner,
36+
repo: context.repo.repo,
37+
target_commitish: sha,
38+
tag_name: tag,
39+
name: tag,
40+
body: `Mirror of https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases/${tag}`,
41+
});

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Swift Package Manager repository for iOS
2+
3+
_Work in progress_
4+
5+
This is a mirror of the main [iOS repository](https://github.com/BranchMetrics/ios-branch-deep-linking-attribution)
6+
for use only with Swift Package Manager. It removes binaries and all commit
7+
history before release [0.35.0](https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases/0.35.0),
8+
the first release to support SPM. This greatly improves performance when using
9+
SPM. Releases to the main repo are automatically replicated here with each
10+
tag.
11+
12+
This is for use only with Swift Package Manager. Please use the main repo for
13+
any other purpose.
14+
15+
See https://help.branch.io/developers-hub/docs/ios-sdk-overview for full
16+
documentation of the Branch iOS SDK.

0 commit comments

Comments
 (0)