Skip to content

Commit c3bf852

Browse files
committed
chore: initial project setup
1 parent c194db3 commit c3bf852

File tree

16 files changed

+2856
-0
lines changed

16 files changed

+2856
-0
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": ["@changesets/changelog-github", { "repo": "magicbell/magicbell-swift-client" }],
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": [],
11+
"privatePackages": {"tag": true, "version": true}
12+
}

.github/sync.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
magicbell/magicbell:
2+
- source: docs-dist
3+
dest: src/go/app/site/docs/mdx/03-libraries/magicbell-swift-client

.github/workflows/publish-docs.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish Docs
2+
3+
on:
4+
release:
5+
types: [created]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 20
18+
- uses: bahmutov/npm-install@v1
19+
20+
- name: Build docs
21+
run: yarn build:docs
22+
23+
- name: Push docs to remote repo
24+
uses: BetaHuhn/repo-file-sync-action@v1
25+
with:
26+
GH_PAT: ${{ secrets.BELLA_ACTION_TOKEN }}
27+
COMMIT_PREFIX: 'docs: '
28+
GIT_USERNAME: 'MagicBella'
29+
GIT_EMAIL: '${{ secrets.BELLA_EMAIL_ADDRESS }}'

.github/workflows/regen.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Regen
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 5 * * 1' # At 05:00 on Monday.
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
regen:
13+
name: Regen
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
token: ${{ secrets.BELLA_ACTION_TOKEN }}
20+
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
- uses: bahmutov/npm-install@v1
25+
26+
- name: Regen `magicbell-java-client`
27+
run: yarn codegen
28+
env:
29+
LIBLAB_TOKEN: ${{ secrets.LIBLAB_ACTION_TOKEN }}
30+
31+
- name: Generate Changeset
32+
shell: bash
33+
run: |
34+
TIMESTAMP=$(date +%s)
35+
mkdir -p .changeset
36+
PACKAGE_NAME=$(jq -r '.name' package.json)
37+
FILE_NAME=".changeset/auto-bump-${PACKAGE_NAME}-${TIMESTAMP}.md"
38+
39+
if [ -z "$PACKAGE_NAME" ] || [ "$PACKAGE_NAME" == "null" ]; then
40+
echo "Warning: Could not find 'name' in package.json. Skipping..."
41+
continue
42+
fi
43+
44+
# Create the Changeset file with the correct package name and minor bump
45+
{
46+
echo "---"
47+
echo ""\"$PACKAGE_NAME\"": minor"
48+
echo "---"
49+
echo ""
50+
echo "Automatic minor version bump for changes in \`$PACKAGE_NAME\`."
51+
} > "$FILE_NAME"
52+
53+
echo "Created Changeset: $FILE_NAME"
54+
55+
- name: Create Pull Request
56+
uses: peter-evans/create-pull-request@v7
57+
with:
58+
token: ${{ secrets.BELLA_ACTION_TOKEN }}
59+
branch: 'feature/regen-sdks'
60+
base: 'main'
61+
title: 'chore: regen sdk'
62+
body: 'Automated PR to update the generated SDK'
63+
commit-message: 'chore: regen sdk'
64+
committer: 'MagicBella <${{ secrets.BELLA_EMAIL_ADDRESS }}>'
65+
author: 'MagicBella <${{ secrets.BELLA_EMAIL_ADDRESS }}>'

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
concurrency: ${{ github.workflow }}-${{ github.ref }}
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
token: ${{ secrets.BELLA_ACTION_TOKEN }}
16+
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
21+
- uses: bahmutov/npm-install@v1
22+
23+
- name: Create release Pull Request or publish release
24+
id: changesets
25+
uses: changesets/action@v1
26+
with:
27+
version: yarn changeset version
28+
publish: yarn changeset publish
29+
commit: 'chore: version package'
30+
title: 'chore: version package'
31+
createGithubReleases: true
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.BELLA_ACTION_TOKEN }}

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Tooling
2+
node_modules/
3+
target
4+
5+
docs-dist
6+
7+
# act
8+
.env
9+
.secrets
10+
11+
# Swift
12+
.DS_Store
13+
/.build
14+
/Packages
15+
xcuserdata/
16+
DerivedData/
17+
.swiftpm/configuration/registries.json
18+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
19+
.netrc

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# magicbell-swift-client

LICENSE

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
The MIT License (MIT)
2+
Copyright © 2024 MagicBell, Inc
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5+
6+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7+
8+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

liblab.config.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"sdkName": "magicbell-swift-client",
3+
"specFilePath": "https://site.magicbell.cloud/docs/api/openapi.user.json",
4+
"apiName": "magicbell-api",
5+
"languages": ["swift"],
6+
"auth": ["bearer"],
7+
"customizations": {
8+
"includeOptionalSnippetParameters": true,
9+
"authentication": {
10+
"access": {
11+
"prefix": "Bearer"
12+
}
13+
},
14+
"inferServiceNames": false,
15+
"injectedModels": [],
16+
"license": {
17+
"type": "MIT"
18+
},
19+
"responseHeaders": false,
20+
"retry": {
21+
"enabled": true,
22+
"maxAttempts": 3,
23+
"retryDelay": 150
24+
}
25+
},
26+
"languageOptions": {
27+
"swift": {
28+
"githubRepoName": "magicbell-swift-client",
29+
"sdkVersion": "0.1.1",
30+
"liblabVersion": "2"
31+
}
32+
},
33+
"publishing": {
34+
"githubOrg": "magicbell"
35+
}
36+
}

0 commit comments

Comments
 (0)