Skip to content

Commit

Permalink
Publish npm canary package
Browse files Browse the repository at this point in the history
  • Loading branch information
varadarajan-tw committed Oct 12, 2023
1 parent 2d68f45 commit b77f1d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -47,33 +47,28 @@ 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: |
NODE_ENV=production yarn build
- 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
2 changes: 1 addition & 1 deletion packages/destination-actions/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit b77f1d0

Please sign in to comment.