Skip to content

Release

Release #103

Workflow file for this run

name: Release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+**"
env:
BUNDLE_PATH: vendor/bundle
jobs:
check-version:
if: github.repository == 'urbanairship/ios-library'
runs-on: macOS-12
steps:
- uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Check Version
run: bash ./scripts/check_version.sh ${{ steps.get_version.outputs.VERSION }}
- name: Slack Notification
uses: homoluctus/slatify@master
with:
type: ${{ job.status }}
job_name: "iOS SDK Release Started :apple_og:"
url: ${{ secrets.SLACK_WEBHOOK }}
build-package:
needs: check-version
runs-on: macOS-12
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gems-
- name: Install Coreutils
run: brew install coreutils
- name: Build SDK
run: make build-package
- name: Upload zip distribution
uses: actions/upload-artifact@v1
with:
name: airship
path: ./build/Airship.zip
- name: Upload Documentation
uses: actions/upload-artifact@v1
with:
name: docs
path: ./build/Documentation
build-samples:
needs: check-version
runs-on: macOS-12
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gems-
- name: Build samples
run: make build-samples
run-tests:
needs: check-version
runs-on: macOS-12
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gems-
- name: Install xcodegen
run: brew install xcodegen
- name: Test
run: make test
deploy:
runs-on: macOS-12
needs: [run-tests, build-package, build-samples]
steps:
- uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Get the release notes
id: get_release_notes
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
NOTES="$(awk "/## Version $VERSION/{flag=1;next}/## Version/{flag=0}flag" CHANGELOG.md)"
NOTES="${NOTES//'%'/%25}"
NOTES="${NOTES//$'\n'/%0A}"
NOTES="${NOTES//$'\r'/%0D}"
echo ::set-output name=NOTES::"$NOTES"
- uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gems-
- name: Download docs
uses: actions/download-artifact@v1
with:
name: docs
path: ./build/Documentation
- name: Download zip distribution
uses: actions/download-artifact@v1
with:
name: airship
path: ./build
- name: Publish Pods
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: make pod-publish
- name: Slack Notification
uses: homoluctus/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: "Publish the Pods ${{ steps.get_version.outputs.VERSION }} :tidepod:"
url: ${{ secrets.SLACK_WEBHOOK }}
- name: Github Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: ${{ steps.get_version.outputs.VERSION }}
body: ${{ steps.get_release_notes.outputs.NOTES }}
draft: false
prerelease: false
- name: Upload zip distribution
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/Airship.zip
asset_name: Airship.zip
asset_content_type: application/zip
- name: Slack Notification
uses: homoluctus/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: "Deploy iOS SDK to Github :octocat:"
url: ${{ secrets.SLACK_WEBHOOK }}
- name: Prepare Carthage
shell: bash
run: |
mkdir -p Carthage/build
unzip build/Airship.zip Carthage/build
cp -R build/*.xcframework Carthage/build
zip -r Airship.xcframeworks.zip Carthage -x "*.DS_Store"
- name: Upload carthage distribution
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Airship.xcframeworks.zip
asset_name: Airship.xcframeworks.zip
asset_content_type: application/zip
- uses: google-github-actions/setup-gcloud@v0
with:
version: "270.0.0"
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
- run: bash ./scripts/upload_docs.sh
- name: Slack Notification
uses: homoluctus/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: "Uploaded iOS SDK API docs :female-doctor: :male-doctor:"
url: ${{ secrets.SLACK_WEBHOOK }}
- name: Slack Notification
uses: homoluctus/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: "Deploy iOS SDK to Bintray :bento:"
url: ${{ secrets.SLACK_WEBHOOK }}
finished:
runs-on: ubuntu-latest
needs: [deploy]
steps:
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Slack Notification
uses: homoluctus/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: ":raised_hands: iOS SDK Released! :raised_hands:"
url: ${{ secrets.SLACK_WEBHOOK }}