Skip to content

Update runner for release #47

Update runner for release

Update runner for release #47

Workflow file for this run

name: Release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
jobs:
build:
runs-on: macos-14-xlarge
timeout-minutes: 20
env:
DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check Version
run: bash ./scripts/check_version.sh ${GITHUB_REF/refs\/tags\//}
- name: Slack Notification
uses: lazy-actions/slatify@master
with:
type: ${{ job.status }}
job_name: "Airship Cordova Plugin Release Started!"
url: ${{ secrets.SLACK_WEBHOOK }}
- name: Run CI
run: |
bash ./scripts/run_ci_tasks.sh -a -i
- name: Slack Notification
uses: lazy-actions/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
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- 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/
- 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: Publish modules
run: |
cd cordova-airship/
npm publish --access public
cd -
cd cordova-airship-hms/
npm publish --access public
cd -
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Docs
run: |
cd cordova-airship/
npm ci
npm run generate-docs
cd -
bash ./scripts/upload_docs.sh ${GITHUB_REF/refs\/tags\//} ./cordova-airship/docs
- name: Github Release
id: create_release
uses: softprops/action-gh-release@v1
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: lazy-actions/slatify@master
with:
type: ${{ job.status }}
job_name: "Airship Cordova Plugin Released!"
url: ${{ secrets.SLACK_WEBHOOK }}
- name: Slack Notification
uses: lazy-actions/slatify@master
if: failure()
with:
type: ${{ job.status }}
job_name: "Airship Cordova Plugin Release Failed :("
url: ${{ secrets.SLACK_WEBHOOK }}