Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
varadarajan-tw committed Oct 17, 2023
1 parent 7532886 commit 8e9d950
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/publish-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
# Remove before merging to master
- add-tar-release-pipeline
- stage
- staging
# Manual trigger
workflow_dispatch:
# branches:
Expand Down Expand Up @@ -51,14 +51,6 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Get Package Version
run: |
PACKAGE_VERSION=$(node -p "require('./packages/destination-actions/package.json').version")
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_VERSION=${PACKAGE_VERSION}-${SHORT_SHA}" >> $GITHUB_ENV
- name: Build
run: |
NODE_ENV=production yarn build
Expand All @@ -70,7 +62,9 @@ jobs:
- name: Publish Canary Packages
run: |
yarn lerna publish --canary --preid $(git branch --show-current) --no-push --no-git-tag-version
yarn lerna publish -y --canary --preid $(git branch --show-current) --no-push --no-git-tag-version --summary-file
echo "ACTION_DESTINATIONS_VERSION=$(jq -r '.[] | select(.packageName == "@segment/action-destinations") | .version' lerna-publish-summary.json)" >> "$GITHUB_ENV"
echo "ACTIONS_CORE_VERSION=$(jq -r '.[] | select(.packageName == "@segment/actions-core") | .version' lerna-publish-summary.json)" >> "$GITHUB_ENV"
- name: Trigger Buildkite Pipeline
run: |
Expand All @@ -79,11 +73,11 @@ jobs:
--header 'Authorization: Bearer ${{ secrets.BUILDKITE_TOKEN }}' \
--header 'Content-Type: application/json' \
--data '{"commit":"HEAD","branch":"ci-test", "message": "Triggered from :github: run ${{ github.run_id }}: Upgrade action-destination packages ${{ env.ACTION_DESTINATION_VERSION }}","env":{
"BRANCH_TO_UPDATE": "${{ github.ref_name }}", "SHORT_SHA": "${{ env.SHORT_SHA }}", "WEEKLY_DEPLOY": "false", "UPGRADE_ACTION_DESTINATIONS": "true", "ACTION_DESTINATIONS_VERSION": "${{ env.ACTION_DESTINATION_VERSION }}", "ACTIONS_RUN_ID": "${{ github.run_id }}" },"meta_data":{}}')
"BRANCH_TO_UPDATE": "${{ github.ref_name }}", "ACTIONS_RELEASE": "true", "CREATE_PR": "false", "UPGRADE_ACTION_DESTINATIONS": "true", "ACTION_DESTINATIONS_VERSION": "${{ env.ACTION_DESTINATIONS_VERSION }}", "ACTIONS_CORE_VERSION": "${{ env.ACTIONS_CORE_VERSION }}", "ACTIONS_RUN_ID": "${{ github.run_id }}" },"meta_data":{}}')
BUILDKITE_URL=$(echo $result | jq -r '.web_url')
if [[ ${BUILDKITE_URL} -eq null ]]; then
echo "Failed to trigger Buildkite pipeline. Reason:$(echo $result | jq -r '.message'))"
exit 1
else
echo "Buildkite pipeline triggered successfully - ${BUILDKITE_URL}"
echo "Buildkite pipeline triggered successfully.
fi
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ const action: ActionDefinition<Settings, Payload> = {
}
}
},
perform: async (request, { settings, payload, stateContext, logger }) => {
logger?.info('Hello world')
perform: async (request, { settings, payload, stateContext }) => {
return processPayload(request, settings, [payload], stateContext)
},
performBatch: async (request, { settings, payload, stateContext }) => {
Expand Down

0 comments on commit 8e9d950

Please sign in to comment.