Skip to content

release-vscode-nightly #37

release-vscode-nightly

release-vscode-nightly #37

name: release-vscode-nightly
on:
schedule:
# Run every day at 00:00 UTC
- cron: "0 0 * * *"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
release:
if: github.repository == 'sourcegraph/cody'
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version-file: .tool-versions
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # SECURITY: pin third-party action hashes
with:
run_install: true
- run: pnpm build
- run: pnpm run test
# Auth for integration tests to send metrics to data team
- id: auth
uses: google-github-actions/auth@v2
# Skip auth if PR is from a fork
if: ${{ !github.event.pull_request.head.repo.fork }}
with:
workload_identity_provider: ${{ secrets.DATA_TEAM_PROVIDER_NAME }}
service_account: ${{ secrets.DATA_TEAM_SA_EMAIL }}
- uses: google-github-actions/setup-gcloud@v2
- run: xvfb-run -a pnpm -C vscode run test:integration
- run: xvfb-run -a pnpm -C vscode run test:e2e
env:
NO_LOG_TESTING_TELEMETRY_CALLS: true
- run: pnpm -C vscode run build
- run: CODY_RELEASE_TYPE=nightly pnpm -C vscode run release
id: create_release
if: github.repository == 'sourcegraph/cody'
env:
VSCODE_MARKETPLACE_TOKEN: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
VSCODE_OPENVSX_TOKEN: ${{ secrets.VSCODE_OPENVSX_TOKEN }}
- name: Tag nightly release
uses: actions/github-script@v6
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.create_release.outputs.version_tag }}",
sha: context.sha
})
- name: Slack Notification
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@b24d75fe0e728a4bf9fc42ee217caa686d141ee8 # SECURITY: pin third-party action hashes
env:
SLACK_CHANNEL: wg-cody-vscode
SLACK_ICON: https://github.com/sourcegraph.png?size=48
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MESSAGE: Nightly build failed
SLACK_COLOR: danger
SLACK_FOOTER: ""
MSG_MINIMAL: actions url