-
Notifications
You must be signed in to change notification settings - Fork 550
updates to release process #1196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shrutiburman
wants to merge
3
commits into
main
Choose a base branch
from
gated-releases
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
| inputs: | ||
| node-version: | ||
| description: "Node version to test with (or 'all' for full matrix)" | ||
| required: false | ||
| default: "all" | ||
| schedule: | ||
| - cron: '30 3 * * 1' # Monday 9AM IST | ||
|
|
||
| env: | ||
| ARTIFACTORY_URL: ${{ vars.ARTIFACTORY_URL }} | ||
|
|
||
| jobs: | ||
| lockfile-hygiene: | ||
| runs-on: ubuntu-x64 | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| - uses: twilio/sdk-actions/npm-lockfile-hygiene@0375437914d535a5fb178bdbfdb5d51bdde2616e # v1 | ||
| with: | ||
| package-manager: npm | ||
|
|
||
| test: | ||
| name: Test - Node ${{ matrix.node-version }} | ||
| needs: [lockfile-hygiene] | ||
| runs-on: ubuntu-x64 | ||
| if: github.repository_owner == 'twilio' | ||
| timeout-minutes: 20 | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| node-version: ${{ (github.event_name == 'schedule' || github.event.inputs.node-version == 'all') && fromJson('["22","24"]') || fromJson(format('["{0}"]', github.event.inputs.node-version || 'lts/*')) }} | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Artifactory OIDC Auth | ||
| uses: twilio/sdk-actions/artifactory-oidc@0375437914d535a5fb178bdbfdb5d51bdde2616e # v1 | ||
|
|
||
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: npm | ||
|
|
||
| - run: npm ci | ||
| - name: Run unit tests + security check + formatting check | ||
| run: npm run ci | ||
| - run: npm run build | ||
|
|
||
| - name: Run cluster tests | ||
| if: ${{ !github.event.pull_request.head.repo.fork }} | ||
| env: | ||
| TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }} | ||
| TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY }} | ||
| TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }} | ||
| TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }} | ||
| TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }} | ||
| TWILIO_ORGS_CLIENT_ID: ${{ secrets.TWILIO_ORGS_CLIENT_ID }} | ||
| TWILIO_ORGS_CLIENT_SECRET: ${{ secrets.TWILIO_ORGS_CLIENT_SECRET }} | ||
| TWILIO_ORGS_USER_ID: ${{ secrets.TWILIO_ORGS_USER_ID }} | ||
| TWILIO_ORG_SID: ${{ secrets.TWILIO_ORG_SID }} | ||
| TWILIO_CLIENT_ID: ${{ secrets.TWILIO_CLIENT_ID }} | ||
| TWILIO_CLIENT_SECRET: ${{ secrets.TWILIO_CLIENT_SECRET }} | ||
| TWILIO_MESSAGE_SID: ${{ secrets.TWILIO_MESSAGE_SID }} | ||
| run: | | ||
| npm pack | ||
| tar -xzf twilio*.tgz | ||
| cd spec/cluster | ||
| npm install | ||
| npm run test | ||
|
|
||
| deploy-dry-run: | ||
| name: Release Readiness Check - Build artifact | ||
| needs: [test] | ||
| runs-on: ubuntu-x64 | ||
| if: github.repository_owner == 'twilio' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') | ||
| permissions: | ||
| contents: read | ||
| id-token: write # required for npm OIDC trusted publishing | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
|
|
||
| - name: Artifactory OIDC Auth | ||
| uses: twilio/sdk-actions/artifactory-oidc@0375437914d535a5fb178bdbfdb5d51bdde2616e # v1 | ||
|
|
||
| # Node 24+ required for npm OIDC trusted publisher support (npm >= 11.5.1) | ||
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 | ||
| with: | ||
| node-version: 24 | ||
|
|
||
| - run: npm ci | ||
| - run: npm run build | ||
| - run: npm pack | ||
| - name: Dry run summary | ||
| run: | | ||
| PKG_VERSION=$(node -p "require('./package.json').version") | ||
| echo "Built artifacts:" | ||
| ls -lh twilio-*.tgz | ||
| echo "" | ||
| echo "Package version: $PKG_VERSION" | ||
| echo "" | ||
| echo "--- DRY RUN COMPLETE ---" | ||
| echo "All pre-release steps passed." | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,80 @@ | ||
| name: Deploy to NPM | ||
| on: | ||
| workflow_dispatch: | ||
| name: Twilio Public release-npm | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
|
|
||
| env: | ||
| ARTIFACTORY_URL: ${{ vars.ARTIFACTORY_URL }} | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Test | ||
| runs-on: ubuntu-x64 | ||
| if: github.repository_owner == 'twilio' | ||
| timeout-minutes: 20 | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| strategy: | ||
| matrix: | ||
| node: [22, 24] | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
|
|
||
| - name: Artifactory OIDC Auth | ||
| uses: twilio/sdk-actions/artifactory-oidc@0375437914d535a5fb178bdbfdb5d51bdde2616e # v1 | ||
|
|
||
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 | ||
| with: | ||
| node-version: ${{ matrix.node }} | ||
| cache: npm | ||
|
|
||
| - run: npm ci | ||
| - name: Run unit tests + security check + formatting check | ||
| run: npm run ci | ||
| - run: npm run build | ||
|
|
||
| deploy: | ||
| name: Publish to npm | ||
| needs: [test] | ||
| runs-on: ubuntu-x64 | ||
| if: success() && github.ref_type == 'tag' && github.repository_owner == 'twilio' | ||
| environment: | ||
| name: production | ||
| url: https://www.npmjs.com/package/twilio/v/${{ github.ref_name }} | ||
| permissions: | ||
| contents: write # required for creating GitHub Release | ||
| id-token: write # required for npm OIDC trusted publishing | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
|
|
||
| - name: Artifactory OIDC Auth | ||
| uses: twilio/sdk-actions/artifactory-oidc@artifactory-oidc@375437914d535a5fb178bdbfdb5d51bdde2616e # v1 | ||
|
|
||
| # Node 24+ required for npm OIDC trusted publisher support (npm >= 11.5.1) | ||
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 | ||
| with: | ||
| node-version: 24 | ||
|
|
||
| - name: Get tagged version | ||
| run: echo "GITHUB_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
|
||
| - name: Create GitHub Release | ||
| uses: sendgrid/dx-automator/actions/release@08b601b726671445abc798ed59881766ec8fefc6 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. test run |
||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - run: npm ci | ||
| - run: npm run build | ||
| # the release tag must be vX.Y.Z (or vX.Y.Z-rc.1) and match package.json's version. | ||
| # Prerelease tag (v1.2.3-rc.1) publishes to the `next` dist-tag automatically. | ||
| - name: Validate tag + publish to npm | ||
| uses: twilio/sdk-actions/npm-publish@0375437914d535a5fb178bdbfdb5d51bdde2616e # v1 | ||
| with: | ||
| registry: 'https://registry.npmjs.org' | ||
| validate-tag: 'true' | ||
| tag-prefix: 'v' | ||
| access: 'public' | ||
| provenance: 'true' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: Test and Deploy | ||
| name: [Deprecated] Test and Deploy | ||
| on: | ||
| push: | ||
| branches: [ '*' ] | ||
|
|
||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.