Merge pull request #419 from urbanairship/MOBILE-4058 #35
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- "[0-9]+.[0-9]+.[0-9]+*" | |
jobs: | |
build: | |
runs-on: macos-11 | |
env: | |
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Check Version | |
run: bash ./scripts/check_version.sh ${GITHUB_REF/refs\/tags\//} | |
- name: Slack Notification | |
uses: homoluctus/slatify@master | |
with: | |
type: ${{ job.status }} | |
job_name: "Airship Cordova Plugin Release Started!" | |
url: ${{ secrets.SLACK_WEBHOOK }} | |
# Build tools 31.0.0 doesn't include dx (only d8), which Cordova expects to find. | |
# Uninstalling causes automatic build-tools resolution to fall back to an older | |
# version that does include dx. | |
- name: Workaround "Build-tool 31.0.0 is missing DX" error | |
run: bash $ANDROID_SDK_ROOT/tools/bin/sdkmanager --uninstall 'build-tools;31.0.0' | |
# Build tools 32.0.0 doesn't include dx (only d8), which Cordova expects to find. | |
# Uninstalling causes automatic build-tools resolution to fall back to an older | |
# version that does include dx. | |
- name: Workaround "Build-tool 32.0.0 is missing DX" error | |
run: bash $ANDROID_SDK_ROOT/tools/bin/sdkmanager --uninstall 'build-tools;32.0.0' | |
- name: Run CI | |
run: | | |
bash ./scripts/run_ci_tasks.sh -a -i | |
- name: Slack Notification | |
uses: homoluctus/slatify@master | |
if: failure() | |
with: | |
type: ${{ job.status }} | |
job_name: "Airship Cordova Plugin Release Failed :(" | |
url: ${{ secrets.SLACK_WEBHOOK }} | |
deploy: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
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" | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Export gcloud related env variable | |
run: export CLOUDSDK_PYTHON="/usr/bin/python3" | |
- uses: actions/setup-node@master | |
with: | |
node-version: 14 | |
registry-url: https://registry.npmjs.org/ | |
- name: Generate documentation | |
run: | | |
yarn install | |
yarn generate-docs | |
- uses: google-github-actions/setup-gcloud@v0 | |
with: | |
version: '351.0.0' | |
service_account_email: ${{ secrets.GCP_SA_EMAIL }} | |
service_account_key: ${{ secrets.GCP_SA_KEY }} | |
- name: Upload docs | |
run: bash ./scripts/upload_docs.sh ${GITHUB_REF/refs\/tags\//} jsdoc_out | |
- name: Publish modules | |
run: | | |
cd urbanairship-cordova/ | |
yarn publish | |
cd - | |
cd urbanairship-accengage-cordova/ | |
yarn publish | |
cd - | |
cd urbanairship-hms-cordova/ | |
yarn publish | |
cd - | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
- name: Github 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: Slack Notification | |
uses: homoluctus/slatify@master | |
with: | |
type: ${{ job.status }} | |
job_name: "Airship Cordova Plugin Released!" | |
url: ${{ secrets.SLACK_WEBHOOK }} | |
- name: Slack Notification | |
uses: homoluctus/slatify@master | |
if: failure() | |
with: | |
type: ${{ job.status }} | |
job_name: "Airship Cordova Plugin Release Failed :(" | |
url: ${{ secrets.SLACK_WEBHOOK }} |