Skip to content
name: Create Enterprise 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.*'
workflow_dispatch:
jobs:
build:
name: Create Enterprise Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: '16.19'
- name: Package Version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- name: modify readme
run: |
echo "" > ./README.md
echo "buildId: ${{ github.sha }}" >> ./README.md
echo "" >> ./README.md
- name: Install
run: yarn install --frozen-lockfile --ignore-optional
- 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: Modify package
run: npm pkg set name=tabnine-vscode-self-hosted-updater && npm pkg set displayName='Tabnine Enterprise' && npm pkg delete __metadata
- name: Package
run: yarn run vsce:package:enterprise --out ./tabnine-vscode-enterprise-${{ steps.package-version.outputs.current-version }}.vsix
- name: Package Contains Extension
run: test "$(unzip -l tabnine-vscode-enterprise-${{ steps.package-version.outputs.current-version }}.vsix | grep out/extension.js | wc -l)" = "1"
- name: Package is Enterprise Extension
run: test "$(unzip -l tabnine-vscode-enterprise-${{ steps.package-version.outputs.current-version }}.vsix | cat out/extension.js | grep tabnine.enterprise)"
- name: Set stable version file
run: |
echo ${{ steps.package-version.outputs.current-version }} > stable
- name: Authenticate to Google Cloud
uses: "google-github-actions/auth@v1"
with:
credentials_json: ${{ secrets.GCS_RELEASE_KEY }}
- name: ⬆️ Upload latest stable version to GCS
uses: google-github-actions/upload-cloud-storage@v1
with:
path: stable
destination: tabnine-self-hosted-artifacts/vscode
parent: false
gzip: false
headers: |-
content-type: text/plain
- name: ⬆️ Upload vsix to GS
uses: google-github-actions/upload-cloud-storage@v0
with:
path: tabnine-vscode-enterprise-${{ steps.package-version.outputs.current-version }}.vsix
destination: tabnine-self-hosted-artifacts/vscode
parent: false