Skip to content
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

Test proxy #4003

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 0 additions & 134 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ jobs:
echo "TOPTAL_BOT_USERNAME=${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_USERNAME }}" >> $GITHUB_ENV
echo "TOPTAL_BOT_JENKINS_DEPLOYMENT_TOKEN=${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_DEPLOYMENT_TOKEN }}" >> $GITHUB_ENV
echo "TOPTAL_JENKINS_BUILD_TOKEN=${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_BUILD_TOKEN }}" >> $GITHUB_ENV
echo "HTTP_PROXY=${{ steps.parse_secrets.outputs.HTTP_PROXY }}" >> $GITHUB_ENV
echo "DEVBOT_TOKEN=${{ steps.parse_secrets.outputs.TOPTAL_DEVBOT_TOKEN }}" >> $GITHUB_ENV

- name: Set up Node.js
Expand Down Expand Up @@ -86,136 +85,3 @@ jobs:
yarn policies set-version
yarn install --frozen-lockfile --offline

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@e9cc34b540dd3ad1b030c57fd97269e8f6ad905a
with:
publish: yarn release
env:
GITHUB_TOKEN: ${{ steps.parse_secrets.outputs.TOPTAL_BUILD_BOT_TOKEN }}
NPM_TOKEN: ${{ steps.parse_secrets.outputs.NPM_TOKEN_PUBLISH }}

- name: Edit "Version Package" PR
if: ${{ steps.changesets.outputs.published != 'true' }}
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
// Get list of all open PRs with
// head branch "changeset-release/master"
// (there should be max 1 PR with such condition)
const { data } = await github.rest.pulls.list({
owner: 'toptal',
repo: 'picasso',
state: 'open',
head: 'toptal:changeset-release/master'
})
for await (let pr of data) {
// add to all of them label "no-jira"
github.rest.issues.addLabels({
owner: 'toptal',
repo: 'picasso',
issue_number: pr.number,
labels: [
'no-jira'
]
})

// append PR body with peerDependencies warning
const hr = "\n_____"
const warningTodo = "\n- [ ] ⚠️ "
const message = "If major release, don't forget to check if peerDependencies needs to be also updated"
const appendedMessage = hr + warningTodo + message
const body = pr.body.includes(message) ? pr.body : pr.body + appendedMessage

github.rest.pulls.update({
owner: 'toptal',
repo: 'picasso',
pull_number: pr.number,
body: body,
})
}

- name: Trigger build image job
uses: toptal/[email protected]
id: trigger-build
env:
JENKINS_JOB_NAME: ${{ env.REPOSITORY_NAME }}-build-image
JENKINS_USER: ${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_USERNAME }}
with:
jenkins_url: https://jenkins-build.toptal.net/
jenkins_user: ${{ env.JENKINS_USER }}
jenkins_token: ${{ env.TOPTAL_JENKINS_BUILD_TOKEN }}
proxy: ${{ env.HTTP_PROXY }}
job_name: ${{ env.JENKINS_JOB_NAME }}
job_params: |
{
"BRANCH": "master",
"VERSION": "${{ github.sha }}",
"IMAGE_NAME": "${{ env.REPOSITORY_NAME }}"
}
job_timeout: "3600"

- name: Trigger deployment job
id: trigger-deploy
uses: toptal/[email protected]
env:
JENKINS_JOB_NAME: ${{ env.REPOSITORY_NAME }}-docs
with:
jenkins_url: https://jenkins-deployment.toptal.net/
jenkins_user: ${{ env.TOPTAL_BOT_USERNAME }}
jenkins_token: ${{ env.TOPTAL_BOT_JENKINS_DEPLOYMENT_TOKEN }}
proxy: ${{ env.HTTP_PROXY }}
job_name: ${{ env.JENKINS_JOB_NAME }}
job_params: |
{
"COMMIT_ID": "${{ github.sha }}"
}
job_timeout: "3600"

- name: Send a Slack notification on failure
if: ${{ failure() }}
uses: slackapi/[email protected]
env:
SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }}
FAILURE_URL: ${{ steps.trigger-deploy.outputs.jenkins_job_url || steps.trigger-build.outputs.jenkins_job_url }}
FALLBACK_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}?check_suite_focus=true
with:
channel-id: "-frontend-exp-team-notifications"
slack-message: ":x: <!here> Current master version of Picasso is <${{ env.FAILURE_URL || env.FALLBACK_URL }}|broken>."

- name: Send a Slack notification on success release
if: ${{ success() && steps.changesets.outputs.published == 'true' }}
uses: slackapi/[email protected]
with:
channel-id: "-frontend-exp-team-notifications"
slack-message: "Current master version of Picasso successfully released :green_heart:"
env:
SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }}
- name: Send a Slack notification on success PR merge
if: ${{ success() && steps.changesets.outputs.published != 'true'}}
uses: slackapi/[email protected]
with:
channel-id: "-frontend-exp-team-notifications"
slack-message: "A new PR was merged to Picasso :parrotspin:"
env:
SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN }}

- uses: toptal/davinci-github-actions/[email protected]
name: Create Jira deployment
if: ${{ steps.changesets.outputs.published == 'true' }}
env:
JENKINS_USER: ${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_USERNAME }}
JENKINS_BUILD_TOKEN: ${{ steps.parse_secrets.outputs.TOPTAL_TRIGGERBOT_BUILD_TOKEN }}
PROXY: http://${{ steps.parse_secrets.outputs.HTTP_PROXY }}
with:
token: ${{ env.DEVBOT_TOKEN }}
environment: production
environment-url: https://www.npmjs.com/package/@toptal/picasso?activeTab=versions

integration-tests:
name: Integration Tests
uses: ./.github/workflows/davinci-integration-tests.yml
secrets:
IDENTITY_POOL: ${{ secrets.IDENTITY_POOL }}
SA_IDENTITY_POOL: ${{ secrets.SA_IDENTITY_POOL }}
Loading