3.41.0 #331
Workflow file for this run
This file contains 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
name: Create Release | |
on: | |
push: | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- 'v*.*.*' # Push events to matching v*, i.e. v1.0.0, v20.15.10 | |
- '!v*.*.*-alpha.*' | |
jobs: | |
build: | |
name: Create Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Tag Version | |
id: tag-version | |
run: echo ::set-output name=RELEASE_VERSION::$(echo ${GITHUB_REF:10}) | |
- name: Package Version | |
id: package-version | |
uses: martinbeentjes/npm-get-version-action@master | |
- name: Tag & Package.json Versions Not Matching | |
if: ${{ format('v{0}', steps.package-version.outputs.current-version) != steps.tag-version.outputs.RELEASE_VERSION}} | |
run: exit 1 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16.10' | |
- name: Install | |
run: yarn install --frozen-lockfile --ignore-optional | |
- name: Replace INSTRUMENTATION_KEY | |
uses: codota/replace-action@v2 | |
with: | |
files: ./src/globals/consts.ts | |
replacements: '<INSTRUMENTATION_KEY>=${{ secrets.INSTRUMENTATION_KEY }}' | |
- name: Get Chat Version | |
id: get_chat_version | |
run: echo "version=$(cat ./.chatversion)" >> $GITHUB_ENV | |
- name: Checkout Chat Application Repository | |
uses: dsaltares/fetch-gh-release-asset@master | |
with: | |
repo: 'codota/tabnine-chat-app' | |
version: 'tags/${{ env.version }}' | |
file: 'build.tar.gz' | |
token: ${{ secrets.GH_BUILDER_TOKEN }} | |
- name: Extract Chat App Build | |
run: | | |
mkdir -p ./chat | |
tar -xzvf ./build.tar.gz -C ./chat | |
- name: Package | |
run: yarn vsce:package | |
- name: Checkout modifier repository | |
uses: actions/checkout@v2 | |
with: | |
repository: codota/vsix-name-modifier | |
ref: main | |
token: ${{ secrets.GH_BUILDER_TOKEN }} | |
path: ./.github/actions/vsix-name-modifier | |
- name: Replace displayName | |
uses: ./.github/actions/vsix-name-modifier | |
with: | |
vsix-file-location: ./tabnine-vscode-${{ steps.package-version.outputs.current-version }}.vsix | |
display-name: Tabnine AI | |
- name: Package Contains Extension | |
run: test "$(unzip -l tabnine-vscode-${{ steps.package-version.outputs.current-version }}.vsix | grep -E "out/extension.js$" | wc -l)" = "1" | |
- name: Package is Public (non enterprise) Extension | |
run: | | |
unzip -d temp tabnine-vscode-${{ steps.package-version.outputs.current-version }}.vsix | |
test "$(cat temp/extension/out/extension.js | grep tabnine.enterprise | wc -l)" = "0" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_name: tabnine-vscode.vsix | |
asset_path: ./tabnine-vscode-${{ steps.package-version.outputs.current-version }}.vsix | |
asset_content_type: application/octet-stream | |
- name: Publish | |
run: yarn vsce:publish --packagePath ./tabnine-vscode-${{ steps.package-version.outputs.current-version }}.vsix | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
- name: Send Slack release message | |
if: success() | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASES_CHANNEL_WEBHOOK_URL }} | |
SLACK_CHANNEL: releases-automation | |
SLACK_TITLE: "vscode ${{ steps.package-version.outputs.current-version }} version released to production" | |
SLACK_USERNAME: "vscode update" | |
SLACK_ICON_EMOJI: ":vscode:" | |
SLACK_MESSAGE: ${{ github.event.head_commit.message }} | |
SLACK_FOOTER: " " | |