Release #97
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-latest | |
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 React Native Release Started!" | |
url: ${{ secrets.SLACK_WEBHOOK }} | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- 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 React Native Release Failed :(" | |
url: ${{ secrets.SLACK_WEBHOOK }} | |
deploy: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- uses: actions/setup-node@master | |
with: | |
node-version: 12 | |
registry-url: https://registry.npmjs.org/ | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- 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: Generate documentation | |
run: | | |
yarn install | |
cd urbanairship-react-native/ | |
yarn generate-docs | |
cd - | |
cd urbanairship-preference-center-react-native/ | |
yarn generate-docs | |
cd - | |
cd urbanairship-chat-react-native/ | |
yarn generate-docs | |
cd - | |
cd urbanairship-accengage-react-native/ | |
yarn generate-docs | |
cd - | |
cd urbanairship-hms-react-native/ | |
yarn generate-docs | |
cd - | |
- 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: google-github-actions/setup-gcloud@daadedc81d5f9d3c06d2c92f49202a3cc2b919ba # v0.2.1 | |
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\//} | |
- name: Publish modules | |
run: | | |
cd urbanairship-react-native/ | |
yarn publish | |
cd - | |
cd urbanairship-preference-center-react-native/ | |
yarn publish | |
cd - | |
cd urbanairship-chat-react-native/ | |
yarn publish | |
cd - | |
cd urbanairship-accengage-react-native/ | |
yarn publish | |
cd - | |
cd urbanairship-hms-react-native/ | |
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 | |
if: success() | |
with: | |
type: ${{ job.status }} | |
job_name: "Airship React native Plugin Released!" | |
url: ${{ secrets.MOBILE_SLACK_WEBHOOK }} | |
- name: Slack Notification | |
uses: homoluctus/slatify@master | |
if: failure() | |
with: | |
type: ${{ job.status }} | |
job_name: "Airship React Native Release Failed :(" | |
url: ${{ secrets.SLACK_WEBHOOK }} |