-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (58 loc) · 2.19 KB
/
pre-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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