From fc4170e1310a558210ccb037498f2ef5469a8140 Mon Sep 17 00:00:00 2001 From: kridai Date: Wed, 15 Dec 2021 18:00:59 +0530 Subject: [PATCH] chore: Debian release fix (#354) --- .../workflows/debian-executable-release.yml | 47 +++++++++++++ .../workflows/platform-exec-sanity-tests.yml | 2 +- .github/workflows/platform-executables.yml | 69 ------------------- .github/workflows/release.yml | 4 +- .github/workflows/slack-notification.yml | 12 +++- 5 files changed, 60 insertions(+), 74 deletions(-) create mode 100644 .github/workflows/debian-executable-release.yml delete mode 100644 .github/workflows/platform-executables.yml diff --git a/.github/workflows/debian-executable-release.yml b/.github/workflows/debian-executable-release.yml new file mode 100644 index 000000000..56b044831 --- /dev/null +++ b/.github/workflows/debian-executable-release.yml @@ -0,0 +1,47 @@ +name: Debian Executable Release +on: + workflow_dispatch: + inputs: + formula: + description: 'Artifact Prefix' + default: twilio +jobs: + debian-executable-release: + name: Publish for ubuntu + runs-on: ubuntu-latest + 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))" + - run: | + make install + sudo $(npm bin)/oclif-dev pack:deb + - name: Upload binaries to release + run: node .github/scripts/update-platform-executables.js + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FILE: dist/deb/${{ github.event.inputs.formula }}_${{ steps.get-tag.outputs.TAG_NAME }}-1_amd64.deb + ASSET_NAME: ${{ github.event.inputs.formula }}-${{ steps.get-tag.outputs.TAG_NAME }}.deb + TAG_NAME: ${{ steps.get-tag.outputs.TAG_NAME }} + REPO_NAME: ${{ github.repository }} + + notify-complete-fail: + if: ${{ failure() || cancelled() }} + needs: [ debian-executable-release ] + 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: 'Debian Executable Release Failed' + MSG_MINIMAL: actions url \ No newline at end of file diff --git a/.github/workflows/platform-exec-sanity-tests.yml b/.github/workflows/platform-exec-sanity-tests.yml index d93d628ca..aefbe0257 100644 --- a/.github/workflows/platform-exec-sanity-tests.yml +++ b/.github/workflows/platform-exec-sanity-tests.yml @@ -3,7 +3,7 @@ on: workflow_dispatch: workflow_run: # wait for Platform Executable Release to complete - workflows: ["Platform Executable Release"] + workflows: ["Debian Executable Release", "Macos Executable Release"] branches: [main] types: - completed diff --git a/.github/workflows/platform-executables.yml b/.github/workflows/platform-executables.yml deleted file mode 100644 index 7d72f5224..000000000 --- a/.github/workflows/platform-executables.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Platform Executable Release -on: - workflow_dispatch: - inputs: - formula: - description: 'Artifact Prefix' - default: twilio -jobs: - get-tag: - runs-on: ubuntu-latest - 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))" - platform-executables-release: - name: Publish for ${{ matrix.os }} - runs-on: ${{ matrix.os }} - needs: [get-tag] - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - artifact_name: deb/${{ github.event.inputs.formula }}_${{ needs.get-tag.outputs.TAG_NAME }}-1_amd64.deb - asset_name: ${{ github.event.inputs.formula }}-${{ needs.get-tag.outputs.TAG_NAME }}.deb - command_name: sudo npx oclif-dev pack:deb - - os: macos-latest - artifact_name: 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 }}.pkg - command_name: npx oclif-dev pack:macos - steps: - - uses: actions/checkout@v2 - - run: | - make install - if [ "$RUNNER_OS" == "macOS" ]; then - brew install makensis - fi - ${{ matrix.command_name }} - - name: Upload binaries to release - run: node .github/scripts/update-platform-executables.js - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - FILE: dist/${{ matrix.artifact_name }} - ASSET_NAME: ${{ matrix.asset_name }} - TAG_NAME: ${{ needs.get-tag.outputs.TAG_NAME }} - REPO_NAME: twilio/twilio-cli - - notify-complete-fail: - if: ${{ failure() || cancelled() }} - needs: [ platform-executables-release ] - 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: 'Platform Executable Release Failed' - MSG_MINIMAL: actions url diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 92dd8d16f..6df21acc9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -212,11 +212,11 @@ jobs: - name: Extract branch name id: extract_branch run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - - name: Invoke Platform Executables workflow + - name: Invoke debian executable workflow if: ${{needs.release.outputs.tag-name != ''}} run: node .github/scripts/trigger-workflow.js env: - WORKFLOW_NAME: 'platform-executables.yml' + WORKFLOW_NAME: 'debian-executable-release.yml' BRANCH_NAME: ${{steps.extract_branch.outputs.branch}} - name: Invoke macos package release workflow diff --git a/.github/workflows/slack-notification.yml b/.github/workflows/slack-notification.yml index 5b270fea2..46c8897c9 100644 --- a/.github/workflows/slack-notification.yml +++ b/.github/workflows/slack-notification.yml @@ -42,14 +42,22 @@ jobs: run: source .github/scripts/trigger-and-wait.sh env: INPUT_WORKFLOW_FILE_NAME: oclif-release.yml - - name: Wait for Platform Executables Release + - name: Wait for debian executables Release run: source .github/scripts/trigger-and-wait.sh env: - INPUT_WORKFLOW_FILE_NAME: platform-executables.yml + INPUT_WORKFLOW_FILE_NAME: debian-executable-release.yml + - name: Wait for windows executables Release + run: source .github/scripts/trigger-and-wait.sh + env: + INPUT_WORKFLOW_FILE_NAME: windows-executable-release.yml - name: Wait for RPM Build run: source .github/scripts/trigger-and-wait.sh env: INPUT_WORKFLOW_FILE_NAME: rpmbuild.yml + - name: Wait for macos executables Release + run: source .github/scripts/trigger-and-wait.sh + env: + INPUT_WORKFLOW_FILE_NAME: macos-executable-release.yml notify-complete-success: needs: [ wait-for-releases ] name: Notify Release Completed