Skip to content

Release

Release #122

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-13
steps:
- uses: actions/checkout@v4
- name: Get the version
id: get_version
run: |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- 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-13
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install Coreutils
run: brew install coreutils
- name: Install Apple Certificate
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.CERTIFICATEXC }}
p12-password: ${{ secrets.CERTIFICATEXC_PASS }}
- name: Build SDK
run: make build-package
- name: Upload zip distribution
uses: actions/upload-artifact@v3
with:
name: airship
path: ./build/Airship.zip
- name: Upload zip distribution
uses: actions/upload-artifact@v3
with:
name: airship-carthage
path: ./build/Airship.xcframeworks.zip
- name: Upload Documentation
uses: actions/upload-artifact@v3
with:
name: docs
path: ./build/Documentation
build-package-xcode15:
needs: check-version
runs-on: macOS-13
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install Coreutils
run: brew install coreutils
- name: Install Apple Certificate
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.CERTIFICATEXC }}
p12-password: ${{ secrets.CERTIFICATEXC_PASS }}
- name: Build SDK
run: make build-package XCODE=15.0
- name: Upload zip distribution
uses: actions/upload-artifact@v3
with:
name: airship-xcode15
path: ./build/Airship.zip
- name: Upload zip distribution
uses: actions/upload-artifact@v3
with:
name: airship-carthage-xcode15
path: ./build/Airship.xcframeworks.zip
- name: Upload Documentation
uses: actions/upload-artifact@v3
with:
name: docs
path: ./build/Documentation
build-samples:
needs: check-version
runs-on: macOS-13
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Build samples
run: make build-samples
run-tests:
needs: check-version
runs-on: macOS-13
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install xcodegen
run: brew install xcodegen
- name: Test
run: make test test-packages
deploy-github:
runs-on: macOS-13
needs: [run-tests, build-package, build-samples, build-package-xcode15]
steps:
- uses: actions/checkout@v4
- name: Get the version
id: get_version
run: |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- 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"
- name: Download zip distribution
uses: actions/download-artifact@v3
with:
name: airship
path: ./build
- name: Download Carthage zip distribution
uses: actions/download-artifact@v3
with:
name: airship-carthage-xcode15
path: ./build
- name: Download Xcode15 zip distribution
uses: actions/download-artifact@v3
with:
name: airship-xcode15
path: ./buildXcode15
- name: Download Xcode15 Carthage zip distribution
uses: actions/download-artifact@v3
with:
name: airship-carthage
path: ./buildXcode15
- 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: Upload carthage 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.xcframeworks.zip
asset_name: Airship.xcframeworks.zip
asset_content_type: application/zip
# - name: Upload Xcode15 zip distribution
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./buildXcode15/Airship.zip
# asset_name: Airship-Xcode15.zip
# asset_content_type: application/zip
# - name: Upload Xcode 15 carthage zip distribution
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./buildXcode15/Airship.xcframeworks.zip
# asset_name: Airship-Xcode15.xcframeworks.zip
# asset_content_type: application/zip
- name: Update prebuilt Xcode 14 repo
env:
GITHUB_TOKEN: ${{ secrets.IOS_DEPLOY_PREBUILT_PAT }}
run: gh --repo urbanairship/ios-library-prebuilt workflow run release.yml
# - name: Update prebuilt Xcode 15 repo
# env:
# GITHUB_TOKEN: ${{ secrets.IOS_DEPLOY_PREBUILT_PAT }}
# run: gh --repo urbanairship/ios-library-prebuilt --ref xcode-15 workflow run release.yml
- 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 }}
deploy-pods:
runs-on: macOS-13
needs: [run-tests, build-package, build-samples]
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Get the version
id: get_version
run: |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- 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 }}
deploy-docs:
runs-on: macOS-13
needs: [run-tests, build-package, build-samples]
steps:
- uses: actions/checkout@v4
- name: Get the version
id: get_version
run: |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Download docs
uses: actions/download-artifact@v3
with:
name: docs
path: ./build/Documentation
- name: Setup GCP Auth
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Upload Docs
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 }}
finished:
runs-on: ubuntu-latest
needs: [deploy-github, deploy-pods, deploy-docs]
steps:
- name: Get the version
id: get_version
run: |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- 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 }}