-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
125 additions
and
44 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,29 @@ | ||
name: pr-check | ||
on: | ||
pull_request: | ||
paths: | ||
- '**.yml' | ||
- 'src/**' | ||
- 'config/**' | ||
permissions: write-all | ||
pull_request: | ||
paths: | ||
- "**.yml" | ||
- "src/**" | ||
- "config/**" | ||
- "resource/**" | ||
- "package.json" | ||
|
||
jobs: | ||
pr-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- run: echo "ok" | ||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
- name: Install the vsce npm package | ||
run: | | ||
npm install | ||
npm install -g vsce | ||
- name: Run headless test | ||
uses: coactions/setup-xvfb@v1 | ||
if: runner.os == 'Linux' | ||
with: | ||
run: xvfb-run -a npm test | ||
- name: Run test | ||
run: npm test | ||
if: runner.os != 'Linux' | ||
pr-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
- run: npm install | ||
- name: Run headless test | ||
uses: coactions/setup-xvfb@v1 | ||
if: runner.os == 'Linux' | ||
with: | ||
run: xvfb-run -a npm test | ||
- name: Run test | ||
run: npm test | ||
if: runner.os != 'Linux' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: pre-release-tag | ||
on: | ||
pull_request: | ||
paths: | ||
- "**.yml" | ||
- "src/**" | ||
- "config/**" | ||
- "resource/**" | ||
- "package.json" | ||
types: | ||
- labeled | ||
|
||
jobs: | ||
pre-release-tag: | ||
if: ${{ github.event.label.name == 'pre-release' }} | ||
permissions: | ||
contents: 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 Git identity | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "nickyinluo" | ||
- name: Get Current Version | ||
id: vscode-ext-pkg-ver | ||
uses: martinbeentjes/[email protected] | ||
|
||
- name: "Automated Version Bump" | ||
id: version-bump | ||
uses: "phips28/gh-action-bump-version@master" | ||
with: | ||
tag-prefix: "v" | ||
version-type: "patch" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: "Output NEW_TAG" | ||
env: | ||
NEW_TAG: ${{ steps.version-bump.outputs.newTag }} | ||
OLD_VER: ${{ steps.vscode-ext-pkg-ver.outputs.current-version }} | ||
run: echo "new tag[$NEW_TAG], old version[$OLD_VER]" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,66 @@ | ||
name: pre-release | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
push: | ||
branches: | ||
- master | ||
- feat/** # debug | ||
tags: | ||
- v* | ||
- v*.*.* | ||
- "v*" | ||
|
||
jobs: | ||
build: | ||
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 install | ||
- name: Run headless test | ||
uses: coactions/setup-xvfb@v1 | ||
if: runner.os == 'Linux' | ||
with: | ||
run: xvfb-run -a npm test | ||
- run: npm test | ||
if: runner.os != 'Linux' | ||
- name: Pre release | ||
- 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.patch | ||
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 |