|
4 | 4 | name: Publish extension to vscode extension marketplace
|
5 | 5 |
|
6 | 6 | on:
|
7 |
| - push: |
8 |
| - tags: |
9 |
| - - v*.*.* |
| 7 | + push: |
| 8 | + tags: |
| 9 | + - v*.*.* |
10 | 10 |
|
11 |
| -jobs: |
12 |
| - build: |
| 11 | +env: |
| 12 | + GITLAB_NPM_TOKEN: ${{secrets.GITLAB_NPM_TOKEN}} |
13 | 13 |
|
14 |
| - runs-on: ubuntu-latest |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + runs-on: ubuntu-latest |
15 | 17 |
|
16 |
| - strategy: |
17 |
| - matrix: |
18 |
| - node-version: [14.x] |
19 |
| - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + node-version: [16.x] |
| 21 | + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ |
20 | 22 |
|
21 |
| - steps: |
22 |
| - - uses: actions/checkout@v2 |
23 |
| - - name: Use Node.js ${{ matrix.node-version }} |
24 |
| - uses: actions/setup-node@v2 |
25 |
| - with: |
26 |
| - node-version: ${{ matrix.node-version }} |
27 |
| - cache: 'npm' |
28 |
| - - run: echo "VERSION=${GITHUB_REF#refs/*/}" |
29 |
| - # add tag value to env |
30 |
| - - run: echo "VERSION=${GITHUB_REF#refs/*/}" | sed 's/v//' >> $GITHUB_ENV |
31 |
| - - run: echo "version:\ ${{ env.VERSION }}" |
32 |
| - # globally install vsce |
33 |
| - - run: npm i -g vsce |
34 |
| - # replace client_id |
35 |
| - - run: sed -i "s/clientId:\ 'vscode-cnb'/clientId:\ '${{ secrets.OAUTHCLIENTID }}'/" src/models/config.ts |
36 |
| - # replace client_secret |
37 |
| - - run: sed -i "s/clientSecret:\ ''/clientSecret:\ '${{ secrets.OAUTHCLIENTSECRET }}'/" src/models/config.ts |
38 |
| - - run: echo "src/models/config.ts\n" && cat src/models/config.ts |
39 |
| - # use env.VERSION to replace version property in package.json |
40 |
| - - run: sed -i 's/\"version\":\ \"[0-9]\.[0-9]\.[0-9]\"/\"version\":\ \"${{ env.VERSION }}\"/' package.json |
41 |
| - - run: echo "package.json\n" && cat package.json |
42 |
| - - run: npm ci |
43 |
| - # publish to vscode extension marketplace |
44 |
| - - run: vsce publish -p ${{ secrets.VSCETOKEN }} |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v2 |
| 25 | + - name: Use Node.js ${{ matrix.node-version }} |
| 26 | + uses: actions/setup-node@v2 |
| 27 | + with: |
| 28 | + node-version: ${{ matrix.node-version }} |
| 29 | + cache: 'npm' |
| 30 | + - run: echo "VERSION=${GITHUB_REF#refs/*/}" |
| 31 | + # add tag value to env |
| 32 | + - run: echo "VERSION=${GITHUB_REF#refs/*/}" | sed 's/v//' >> $GITHUB_ENV |
| 33 | + - run: echo "version:\ ${{ env.VERSION }}" |
| 34 | + # globally install vsce |
| 35 | + - run: npm i -g vsce |
| 36 | + # replace client_id |
| 37 | + - run: sed -i "s/clientId:\ 'vscode-cnb'/clientId:\ '${{ secrets.OAUTHCLIENTID }}'/" src/models/config.ts |
| 38 | + # replace client_secret |
| 39 | + - run: sed -i "s/clientSecret:\ ''/clientSecret:\ '${{ secrets.OAUTHCLIENTSECRET }}'/" src/models/config.ts |
| 40 | + - run: echo "src/models/config.ts\n" && cat src/models/config.ts |
| 41 | + # use env.VERSION to replace version property in package.json |
| 42 | + - run: sed -i 's/\"version\":\ \"[0-9]\.[0-9]\.[0-9]\"/\"version\":\ \"${{ env.VERSION }}\"/' package.json |
| 43 | + - run: echo "package.json\n" && cat package.json |
| 44 | + - run: npm ci |
| 45 | + # publish to vscode extension marketplace |
| 46 | + - run: vsce publish -p ${{ secrets.VSCETOKEN }} |
0 commit comments