Skip to content

Release

Release #112

Workflow file for this run

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-12
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-12
needs: [authorize]
strategy:
matrix:
ruby-version: ["2.7.x"]
node-version: ["12.x"]
steps:
- name: Checkout Amplitude-iOS
uses: actions/checkout@v2
- name: Set Xcode 14
run: |
sudo xcode-select -switch /Applications/Xcode_14.1.app
- name: Carthage Bootstrap
run: carthage bootstrap --use-xcframeworks
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Install Cocoapods
run: |
gem install bundler
bundle config path vendor/bundle
bundle install
pod install
- name: iOS Tests
run: |
xcodebuild test \
-workspace Amplitude.xcworkspace \
-scheme Amplitude_iOSTests \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 14'
# - name: macOS Tests @TODO Fix flaky macOS tests and re-enable
# run: |
# xcodebuild \
# -workspace Amplitude.xcworkspace \
# -scheme Amplitude_macOS \
# -sdk macosx \
# -destination 'platform=macosx' \
# test
- name: tvOS Tests
run: |
xcodebuild \
-workspace Amplitude.xcworkspace \
-scheme Amplitude_tvOS \
-sdk appletvsimulator \
-destination 'platform=tvOS Simulator,name=Apple TV' \
test
- name: Validate Podfile
run: pod lib lint
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Checkout Amplitude-iOS gh-pages for building docs
uses: actions/checkout@v2
with:
ref: "gh-pages"
path: "Amplitude-iOS-gh-pages"
- name: Install appledoc binary
run: |
git clone https://github.com/amplitude/appledoc
cd appledoc/
sudo sh install-appledoc.sh
cd ../
sudo rm -rf appledoc/
- 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