Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add actions #13

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/jira-issue-create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Creates jira tickets for new github issues to help triage
name: Jira Issue Creator For Swift

on:
issues:
types: [opened]
workflow_call:
inputs:
label:
type: string

jobs:
call-workflow-passing-data:
uses: amplitude/Amplitude-TypeScript/.github/workflows/jira-issue-create-template.yml@main
with:
label: "SessionReplay-iOS"
subcomponent: "dx_ios_sdk_(session_replay)"
secrets:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }}
19 changes: 19 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Lint

on:
pull_request:
push:
branches:
- main

jobs:
lint:
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Xcode 15
run: |
sudo xcode-select -switch /Applications/Xcode_15.2.app
- name: Lint
run: swiftlint --strict # force to fix warnings too
74 changes: 74 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Release

on:
workflow_dispatch:
inputs:
dryRun:
description: "Do a dry run to preview instead of a real release"
required: true
default: "true"

jobs:
authorize:
name: Authorize
runs-on: macos-13
steps:
- name: ${{ github.actor }} permission check to do a release
uses: octokit/[email protected]
with:
route: GET /repos/:repository/collaborators/${{ github.actor }}
repository: ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release:
name: Release
runs-on: macos-13
needs: [authorize]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Xcode 15
run: |
sudo xcode-select -switch /Applications/Xcode_15.2.app

- name: Validate Podfile
run: pod lib lint --allow-warnings

- name: Semantic Release --dry-run
if: ${{ github.event.inputs.dryRun == 'true'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
GIT_AUTHOR_NAME: amplitude-sdk-bot
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: amplitude-sdk-bot
GIT_COMMITTER_EMAIL: [email protected]
run: |
npx \
-p lodash \
-p semantic-release@17 \
-p @semantic-release/changelog@5 \
-p @semantic-release/git@9 \
-p @google/[email protected] \
-p @semantic-release/exec@5 \
semantic-release --dry-run

- name: Semantic Release
if: ${{ github.event.inputs.dryRun == 'false'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
GIT_AUTHOR_NAME: amplitude-sdk-bot
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: amplitude-sdk-bot
GIT_COMMITTER_EMAIL: [email protected]
run: |
npx \
-p lodash \
-p semantic-release@17 \
-p @semantic-release/changelog@5 \
-p @semantic-release/git@9 \
-p @google/[email protected] \
-p @semantic-release/exec@5 \
semantic-release
22 changes: 22 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
disabled_rules:
- file_length
- line_length
- function_body_length
- type_body_length
- trailing_comma
- opening_brace
- todo
- cyclomatic_complexity
- non_optional_string_data_conversion
identifier_name:
allowed_symbols: "_"
min_length: 1
nesting:
type_level:
warning: 3
error: 6
function_level:
warning: 5
error: 10
excluded:
- .build
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ import AmplitudeSessionReplay
}
}

fileprivate final class LoggerWrapper: AmplitudeSessionReplay.Logger {
private final class LoggerWrapper: AmplitudeSessionReplay.Logger {

private let logger: any AmplitudeSwift.Logger

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ import AmplitudeSessionReplay
eventProperties.addEntries(from: sessionReplay.additionalEventProperties)
payload.event["event_properties"] = eventProperties

next(payload);
next(payload)
}

public func amplitude(_ amplitude: Amplitude, didUploadEventsManually manually: Bool) {
Expand Down
Loading