diff --git a/.github/workflows/tar-publish-action-destinations.yml b/.github/workflows/publish-canary.yml similarity index 71% rename from .github/workflows/tar-publish-action-destinations.yml rename to .github/workflows/publish-canary.yml index d144ecce883..dc07566c9c1 100644 --- a/.github/workflows/tar-publish-action-destinations.yml +++ b/.github/workflows/publish-canary.yml @@ -1,7 +1,7 @@ -# This workflow will build and publish Action Destination TAR file as workflow artifact. +# This workflow will build and publish Action Destination package and trigger a buildkite workflow for updating integrations. # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages -name: Update Integration (pre-production) +name: Publish Canry on: workflow_dispatch: @@ -47,7 +47,7 @@ jobs: SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8` echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV echo "SHORT_SHA=${SHORT_SHA}" >> $GITHUB_ENV - echo "ACTION_DESTINATION_PACKAGE=action-destinations-${PACKAGE_VERSION}-${SHORT_SHA}" >> $GITHUB_ENV + echo "ACTION_DESTINATION_VERSION=${PACKAGE_VERSION}-${SHORT_SHA}" >> $GITHUB_ENV - name: Build Action run: | @@ -55,25 +55,20 @@ jobs: - name: Package TAR file run: | - yarn cloud pack -f action-destinations-${{ env.PACKAGE_VERSION }}-${{ env.SHORT_SHA }}.tgz - - - name: Upload TAR file - uses: actions/upload-artifact@v3 - with: - name: action-destinations-${{ env.PACKAGE_VERSION }}-${{ env.SHORT_SHA }}.tgz - path: packages/destination-actions/action-destinations-${{ env.PACKAGE_VERSION }}-${{ env.SHORT_SHA }}.tgz - retention-days: 5 + yarn cloud publish tag --canary --new-version "${{ env.ACTION_DESTINATION_VERSION }}" --no-git-tag-version - name: Trigger a Integrations Build run: | - result=`$(curl -write-out "%{http_code}" --request POST \ + result=$(curl --request POST \ --url https://api.buildkite.com/v2/organizations/segment/pipelines/integrations/builds \ --header 'Authorization: Bearer ${{ secrets.INTEGRATIONS_BUILDKITE_TOKEN }}' \ --header 'Content-Type: application/json' \ --data '{"commit":"HEAD","branch":"ci-test",":github: Update action destination version with action-destinations-${{ env.PACKAGE_VERSION }}-${{ env.SHORT_SHA }}","env":{ - "ACTIONS_BRANCH": "${{ github.ref_name }}", "TRIGGERED_FROM_GHA": "true", "ACTION_DESTINATION_ARTIFACT": "action-destinations-${{ env.PACKAGE_VERSION }}-${{ env.SHORT_SHA }}.tgz", "ACTIONS_RUN_ID": "${{ github.run_id }}" },"meta_data":{}}'\ - | awk 'END {print $0}')` - if [ $result != "201"] + "ACTIONS_BRANCH": "${{ github.ref_name }}", "TRIGGERED_FROM_GHA": "true", "ACTION_DESTINATION_ARTIFACT": "action-destinations-${{ env.PACKAGE_VERSION }}-${{ env.SHORT_SHA }}.tgz", "ACTIONS_RUN_ID": "${{ github.run_id }}" },"meta_data":{}}') + BUILDKITE_URL=$(echo $result | jq -r '.web_url') + if [[ -z "$BUILDKITE_URL"]]; then exit 1 + else + echo "Build triggered successfuly - ${BUILDKITE_URL}" fi diff --git a/packages/destination-actions/package.json b/packages/destination-actions/package.json index 8612b95020f..40b966228cb 100644 --- a/packages/destination-actions/package.json +++ b/packages/destination-actions/package.json @@ -1,7 +1,7 @@ { "name": "@segment/action-destinations", "description": "Destination Actions engine and definitions.", - "version": "3.220.0", + "version": "3.220.0-54bb01e8", "repository": { "type": "git", "url": "https://github.com/segmentio/action-destinations",