Macos Executable Release #67
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: Macos Executable Release | |
on: | |
workflow_dispatch: | |
inputs: | |
formula: | |
description: 'Artifact Prefix' | |
default: twilio | |
jobs: | |
get-tag: | |
runs-on: macos-11 | |
outputs: | |
TAG_NAME: ${{steps.get-tag.outputs.TAG_NAME}} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Getting latest tag | |
id: get-tag | |
run: | | |
git fetch --prune --unshallow | |
echo "::set-output name=TAG_NAME::$(git describe --tags $(git rev-list --tags --max-count=1))" | |
get-sha: | |
runs-on: macos-11 | |
outputs: | |
SHA_SHORT: ${{steps.get-sha.outputs.SHA_SHORT}} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Getting short sha | |
id: get-sha | |
run: | | |
git fetch --prune --unshallow | |
echo "::set-output name=SHA_SHORT::$(git rev-parse --short HEAD)" | |
pack-macos: | |
needs: [get-tag, get-sha] | |
runs-on: macos-11 | |
steps: | |
- uses: actions/checkout@v2 | |
- run: source .github/scripts/pack_macos.sh | |
env: | |
OSX_INSTALLER_CERT_BASE64: ${{ secrets.OSX_INSTALLER_CERT_BASE64}} | |
OSX_INSTALLER_CERT_PASSWORD: ${{ secrets.OSX_INSTALLER_CERT_PASSWORD}} | |
APPLE_ID: ${{ secrets.APPLE_ID}} | |
APPLE_ID_APP_PASSWORD: ${{ secrets.APPLE_ID_APP_PASSWORD}} | |
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID}} | |
# FILE_PATH_ARM64: dist/macos/${{ github.event.inputs.formula }}-v${{ needs.get-tag.outputs.TAG_NAME }}-${{ needs.get-sha.outputs.SHA_SHORT }}-arm64.pkg | |
FILE_PATH_X64: dist/macos/${{ github.event.inputs.formula }}-v${{ needs.get-tag.outputs.TAG_NAME }}.pkg | |
REPOSITORY_OWNER: ${{ github.repository_owner }} | |
# TODO: enable these when oclif pack : macos starts working fine | |
# - name: Upload binaries to release - arm64 | |
# if: always() | |
# run: node .github/scripts/update-platform-executables.js | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# FILE: dist/macos/${{ github.event.inputs.formula }}-v${{ needs.get-tag.outputs.TAG_NAME }}-${{ needs.get-sha.outputs.SHA_SHORT }}-arm64.pkg | |
# ASSET_NAME: ${{ github.event.inputs.formula }}-${{ needs.get-tag.outputs.TAG_NAME }}-arm64.pkg | |
# TAG_NAME: ${{ needs.get-tag.outputs.TAG_NAME }} | |
# REPO_NAME: ${{ github.repository }} | |
- name: Upload binaries to release - x64 | |
if: always() | |
run: | | |
node .github/scripts/update-platform-executables.js | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
FILE: dist/macos/${{ github.event.inputs.formula }}-v${{ needs.get-tag.outputs.TAG_NAME }}.pkg | |
ASSET_NAME: ${{ github.event.inputs.formula }}-${{ needs.get-tag.outputs.TAG_NAME }}-x64.pkg | |
TAG_NAME: ${{ needs.get-tag.outputs.TAG_NAME }} | |
REPO_NAME: ${{ github.repository }} | |
notify-complete-fail: | |
if: ${{ failure() || cancelled() }} | |
needs: [pack-macos] | |
name: Notify Release Failed | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Slack Notification | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.ALERT_SLACK_WEB_HOOK }} | |
SLACK_COLOR: "#ff3333" | |
SLACK_USERNAME: CLI Release Bot | |
SLACK_ICON_EMOJI: ":ship:" | |
SLACK_TITLE: "Twilio Cli" | |
SLACK_MESSAGE: 'Macos Executable Release Failed' | |
MSG_MINIMAL: actions url |