update readme #22
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: pre-release | |
on: | |
pull_request: | |
types: | |
- closed | |
push: | |
tags: | |
- "v*" | |
jobs: | |
pre-release: | |
if: github.event.pull_request.merged == true || startsWith(github.ref, 'refs/tags/') | |
permissions: | |
contents: write | |
pull-requests: write | |
runs-on: ubuntu-latest | |
environment: RELEASE_ENV | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- run: npm ci | |
- name: Set tags from commit tag | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
NEW_TAG=${GITHUB_REF#refs/tags/} | |
echo "NEW_TAG=$NEW_TAG" >> $GITHUB_ENV | |
echo "new tag[${{ env.NEW_TAG }}] from commit tag will be set" | |
- name: Get Current Version | |
id: vscode-ext-pkg-ver | |
uses: martinbeentjes/[email protected] | |
- name: Set tags from label | |
if: startsWith(github.ref, 'refs/heads/') | |
run: | | |
echo "NEW_TAG=${{ steps.vscode-ext-pkg-ver.outputs.current-version}}" >> $GITHUB_ENV | |
echo "new tag [${{ env.NEW_TAG }}] from label will be set" | |
- run: echo "NEW_TAG:[${{ env.NEW_TAG }}]" | |
- name: Set Git identity | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "nickyinluo" | |
- name: Package extension | |
if: success() | |
run: | | |
npm run package.current | |
env: | |
VSCE_PAT: ${{ secrets.VS_MARKETPLACE_TOKEN }} | |
- name: Pre-release to Github | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: ${{ env.NEW_TAG }} | |
prerelease: true | |
title: "v${{ env.NEW_TAG }}-beta" | |
files: | | |
vscode-tencentcloud-terraform-*.vsix |