diff --git a/.github/workflows/platform-exec-sanity-tests.yml b/.github/workflows/platform-exec-sanity-tests.yml new file mode 100644 index 000000000..d93d628ca --- /dev/null +++ b/.github/workflows/platform-exec-sanity-tests.yml @@ -0,0 +1,72 @@ +name: Platform Executable Sanity testing +on: + workflow_dispatch: + workflow_run: + # wait for Platform Executable Release to complete + workflows: ["Platform Executable Release"] + branches: [main] + types: + - completed + +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-exec-test: + name: Test for ${{ matrix.os }} + runs-on: ${{ matrix.os }} + needs: [get-tag] + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + extension_type: '.deb' + cmds_to_execute: sudo dpkg -i twilio-${{ needs.get-tag.outputs.TAG_NAME }}.deb + - os: macos-latest + extension_type: '.pkg' + cmds_to_execute: sudo installer -pkg twilio-${{ needs.get-tag.outputs.TAG_NAME }}.pkg -target ~/ + steps: + - name: Checkout cli repo + uses: actions/checkout@v2 + - name: Perform sanity install and test on binaries + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release download ${{ needs.get-tag.outputs.TAG_NAME }} --pattern '*${{matrix.extension_type}}' + ${{matrix.cmds_to_execute}} + ls + twilio --version + twilio api --help + platform-exec-test-Windows: + name: Test for Windows + runs-on: windows-latest + needs: [get-tag] + steps: + - name: Checkout cli repo + uses: actions/checkout@v2 + - name: Perform sanity install and tests on Windows + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release download ${{ needs.get-tag.outputs.TAG_NAME }} --pattern '*.exe' + ls + iwr -useb get.scoop.sh | iex + scoop install gsudo + ./twilio-${{ needs.get-tag.outputs.TAG_NAME }}.exe /S + sleep 100 + $env:Path += ";C:\Program Files (x86)\twilio-cli\bin" + $Env:Path + cd C:\"Program Files (x86)\twilio-cli" + dir + twilio --version + twilio api --help + diff --git a/.github/workflows/platform-executables.yml b/.github/workflows/platform-executables.yml index a7aab9774..7d72f5224 100644 --- a/.github/workflows/platform-executables.yml +++ b/.github/workflows/platform-executables.yml @@ -33,7 +33,6 @@ jobs: 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: | @@ -50,6 +49,7 @@ jobs: 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 ] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1255ffd63..9dc8578f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,10 +89,12 @@ jobs: if: ${{steps.semantic-release.outputs.TAG_NAME != ''}} run: node .github/scripts/update-release.js env: - REPO_ACCESS_TOKEN: ${{ github.token }} TAG_NAME: ${{steps.semantic-release.outputs.TAG_NAME}} RELEASE_BODY: ${{github.event.inputs.change-log}} REPO_NAME: twilio/twilio-cli + REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + INPUTS: '{ "tag-name": "${{needs.release.outputs.draft-tag-name}}" }' delete-draft-release: if: ${{github.event.inputs.draft-release == 'true' && needs.release.outputs.draft-tag-name != ''}} runs-on: ubuntu-latest @@ -139,6 +141,7 @@ jobs: INPUTS: '{ "home-brew-branch": "${{github.event.inputs.homebrew-branch}}", "tag-name": "${{needs.release.outputs.draft-tag-name}}-draft", "pre-release": "${{github.event.inputs.homebrew-prerelease}}"}' oclif-draft-sanity-test: runs-on: ubuntu-latest + if: ${{github.event.inputs.draft-release == 'true'}} needs: [oclif-release] steps: - name: Extract branch name @@ -162,10 +165,10 @@ jobs: INPUTS: '{ "version": "${{ steps.semantic-release-draft.outputs.TAG_NAME }}" }' delete-draft-release-oclif: runs-on: ubuntu-latest + if: ${{github.event.inputs.draft-release == 'true'}} needs: [oclif-release] steps: - name: Delete draft release - if: ${{github.event.inputs.draft-release == 'true'}} run: node .github/scripts/trigger-workflow.js env: WORKFLOW_NAME: '.github/workflows/delete-draft-tag-release.yml' @@ -195,7 +198,6 @@ jobs: REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} BRANCH_NAME: ${{steps.extract_branch.outputs.branch}} platform-executables-release: - if: ${{github.event.inputs.draft-release != 'true'}} runs-on: ubuntu-latest needs: [ release ] steps: @@ -215,6 +217,7 @@ jobs: REPO_NAME: twilio/twilio-cli REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} BRANCH_NAME: ${{steps.extract_branch.outputs.branch}} + notify-complete-fail: if: ${{ failure() || cancelled() }} needs: [ release, oclif-release, platform-executables-release ] diff --git a/.releaserc.json b/.releaserc.json index 242d28fe3..2d867eca1 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -62,7 +62,7 @@ "changelogFile": "CHANGES.md" } ], - "@semantic-release/npm", + "@semantic-release/npm", [ "@semantic-release/github", { diff --git a/package-lock.json b/package-lock.json index 33c92c6c9..3b16eefe1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "twilio-cli", - "version": "2.32.1", + "version": "2.34.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "twilio-cli", - "version": "2.32.1", + "version": "2.34.0", "hasInstallScript": true, "license": "MIT", "dependencies": {