Skip to content

feat: send CI status to cloud (#3359) #24

feat: send CI status to cloud (#3359)

feat: send CI status to cloud (#3359) #24

name: Publish packages to NPM
on:
workflow_dispatch:
push:
branches:
- main
paths:
#If there are changes to package.json and ci:release v is in commit msg, it's a release
- 'packages/artillery/package.json'
jobs:
publish-fargate-worker-image:
if: >
github.event_name == 'workflow_dispatch' ||
contains(github.event.head_commit.message, 'ci: release v')
uses: ./.github/workflows/docker-ecs-worker-image.yml
permissions:
contents: read
id-token: write
with:
COMMIT_SHA: ${{ github.sha }}
SHOULD_BUILD_ARM64: true
secrets:
ECR_WORKER_IMAGE_PUSH_ROLE_ARN: ${{ secrets.ECR_WORKER_IMAGE_PUSH_ROLE_ARN }}
publish-packages-to-npm:
runs-on: ubuntu-latest
if: >
github.event_name == 'workflow_dispatch' ||
contains(github.event.head_commit.message, 'ci: release v')
needs: publish-fargate-worker-image
permissions:
contents: read
packages: write
outputs:
ARTILLERY_VERSION: ${{ steps.get-artillery-version.outputs.ARTILLERY_VERSION }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# this list should be kept in sync with create-release-pr.yml
PACKAGES_TO_RELEASE: "\
artillery-engine-playwright,\
artillery-plugin-apdex,\
artillery-plugin-ensure,\
artillery-plugin-expect,\
artillery-plugin-fake-data,\
artillery-plugin-slack,\
artillery-plugin-metrics-by-endpoint,\
artillery-plugin-publish-metrics,\
commons,\
core,\
artillery"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
scope: '@artilleryio'
- run: node .github/workflows/scripts/replace-package-versions.js
# It must be published in this specific order to account for order of dependencies (e.g. artillery depends on commons, core, etc), in case failures happen in publishing.
- run: npm -w @artilleryio/int-commons publish
- run: npm -w @artilleryio/int-core publish
- run: npm -w artillery-plugin-expect publish
- run: npm -w artillery-plugin-publish-metrics publish
- run: npm -w artillery-plugin-metrics-by-endpoint publish
- run: npm -w artillery-plugin-ensure publish
- run: npm -w artillery-plugin-apdex publish
- run: npm -w artillery-engine-playwright publish
- run: npm -w artillery-plugin-fake-data publish
- run: npm -w artillery-plugin-slack publish
- run: npm -w artillery publish
- id: get-artillery-version
run: |
ARTILLERY_VERSION=$(node -e "console.log(require('./packages/artillery/package.json').version)")
echo "ARTILLERY_VERSION=$ARTILLERY_VERSION" >> $GITHUB_OUTPUT
# # Skytrace is a Typescript Package and needs to install -> build -> publish
# - run: npm install -w skytrace --ignore-scripts
# - run: npm run build -w skytrace
# - run: npm -w skytrace publish
publish-official-docker-image:
uses: ./.github/workflows/docker-publish-artillery.yml
if: >
github.event_name == 'workflow_dispatch' ||
contains(github.event.head_commit.message, 'ci: release v')
needs: publish-packages-to-npm
with:
COMMIT_SHA: ${{ github.sha }}
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run-distributed-tests:
uses: ./.github/workflows/run-distributed-tests.yml
needs: publish-packages-to-npm
with:
ARTILLERY_VERSION_OVERRIDE: ${{ needs.publish-packages-to-npm.outputs.ARTILLERY_VERSION }}
HAS_ARM64_BUILD: true
permissions:
contents: read
id-token: write
secrets:
ARTILLERY_CLOUD_ENDPOINT_TEST: ${{ secrets.ARTILLERY_CLOUD_ENDPOINT_TEST }}
ARTILLERY_CLOUD_API_KEY_TEST: ${{ secrets.ARTILLERY_CLOUD_API_KEY_TEST }}
DD_TESTS_API_KEY: ${{ secrets.DD_TESTS_API_KEY }}
DD_TESTS_APP_KEY: ${{ secrets.DD_TESTS_APP_KEY }}
AWS_TEST_EXECUTION_ROLE_ARN_TEST5: ${{ secrets.AWS_TEST_EXECUTION_ROLE_ARN_TEST5 }}
publish-cloudformation-templates-to-s3:
uses: ./.github/workflows/s3-publish-cf-templates.yml
needs: run-distributed-tests
with:
canary: true
permissions:
contents: read
id-token: write
secrets:
AWS_ASSET_UPLOAD_ROLE_ARN: ${{ secrets.AWS_ASSET_UPLOAD_ROLE_ARN }}