From c45f00943e7ca559642d451e70f0c54f53176f79 Mon Sep 17 00:00:00 2001 From: Vinicios Clarindo Date: Thu, 1 Oct 2020 15:37:31 -0300 Subject: [PATCH] ci(deploy): improve production deploy strategy with tags Improved CI/CD for deploy in production, now only need change the version on tagname like prod-v0.20.5 this will build and send the version 0.20.5 to the Extensions. issue #17 --- .github/workflows/production-deploy.yml | 22 +++++++++++++++++----- CHANGELOG.md | 4 ++++ package.json | 2 +- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/production-deploy.yml b/.github/workflows/production-deploy.yml index 2def3b8..09dbb0d 100644 --- a/.github/workflows/production-deploy.yml +++ b/.github/workflows/production-deploy.yml @@ -1,18 +1,18 @@ -name: CI/CD Production +name: CD - Production env: - VSCE_DEPLOY_TOKEN: ${{ secrets.VSCE_DEPLOY_TOKEN }} + VSCE_DEPLOY_TOKEN: ${{ secrets.VSCE_DEPLOY_TOKEN }} # set visual studio deploy token globally on: push: tags: - - deploy-v*.*.* + - prod-v*.*.* jobs: publish: - name: Publish extension, using node ${{ matrix.node_version }} on ${{ matrix.os }} + name: Deploy extension to production, with node ${{ matrix.node_version }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: - node_version: ["12"] + node_version: ['12'] os: [ubuntu-latest] steps: @@ -22,6 +22,18 @@ jobs: with: node-version: ${{ matrix.node_version }} + - name: Extract version from tag name + uses: olegtarasov/get-tag@v2 # that generate $GIT_TAG_NAME env follows semantic versioning + id: tagName + with: + tagRegex: 'prod-v([0-9]+.[0-9]+.[0-9]+)' # Optional. Returns specified group text as tag name. Full tag string is returned if regex is not defined. + tagRegexGroup: 1 # Optional. Default is 1. + + - name: Replace package.json version with tag version + run: | + sed -i 's/99.99.99/'$GIT_TAG_NAME'/g' package.json| + echo "Tag version used:"$GIT_TAG_NAME + - name: npm install and publish run: | npm install diff --git a/CHANGELOG.md b/CHANGELOG.md index 1370ba8..5a00378 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 0.20.5 + +- FIX - Improved CI/CD for deploy in production, now only need change the version on tagname like prod-v0.20.5 this will build and send the version 0.20.5 to the Extensions. + ## 0.20.4 - NEW - Tests for apk file picker, including apk install use cases. diff --git a/package.json b/package.json index 4f4a802..71d7e59 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "adb-interface-vscode", "displayName": "ADB Interface for VSCode", "description": "An interface that allows ADB commands inside IDE with no need to have terminal access.", - "version": "0.20.4", + "version": "0.20.5", "publisher": "vinicioslc", "repository": "https://github.com/vinicioslc/adb-interface-vscode", "engines": {