|
| 1 | +name: release |
| 2 | + |
1 | 3 | on: |
2 | | - release: |
3 | | - types: [created] |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - '[0-9].[0-9]+.[0-9]+' # Push events matching all semantic versioning tags, i.e. 0.26.01, 1.0, v20.15.10 |
4 | 7 |
|
5 | 8 | env: |
6 | 9 | NODE_VERSION: '12.x' |
7 | | - VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }} |
8 | 10 |
|
9 | 11 | jobs: |
10 | | - build-and-deploy: |
11 | | - name: Build and Deploy |
| 12 | + release: |
12 | 13 | runs-on: ubuntu-latest |
13 | 14 | steps: |
14 | | - - uses: actions/checkout@v2 |
15 | | - - name: Use Node.js ${{ env.NODE_VERSION }} |
16 | | - uses: actions/setup-node@v1 |
17 | | - with: |
18 | | - node-version: ${{ env.NODE_VERSION }} |
19 | | - - name: npm install, build, and test |
20 | | - run: | |
21 | | - npm install |
22 | | - npm run build --if-present |
23 | | - npm run test --if-present |
24 | | - - name: 'Deploy to Azure WebApp' |
25 | | - run: | |
26 | | - npm publish -p $VSCE_TOKEN |
| 15 | + - uses: actions/checkout@v2 |
| 16 | + - name: Node ${{ env.NODE_VERSION }} |
| 17 | + uses: actions/setup-node@v1 |
| 18 | + with: |
| 19 | + node-version: ${{ env.NODE_VERSION }} |
| 20 | + |
| 21 | + - name: Package vsix |
| 22 | + id: create_package |
| 23 | + run: | |
| 24 | + npm i |
| 25 | + npx vsce package |
| 26 | +
|
| 27 | + - name: Set vsix version |
| 28 | + id: vsce |
| 29 | + run: | |
| 30 | + echo "::set-output name=version::$(cat package.json | jq -r .version)" |
| 31 | +
|
| 32 | + - name: Create Github Release |
| 33 | + id: create_github_release |
| 34 | + uses: actions/create-release@v1 |
| 35 | + env: |
| 36 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 37 | + with: |
| 38 | + tag_name: ${{ github.ref }} |
| 39 | + release_name: ${{ steps.vsce.outputs.version }} |
| 40 | + draft: false |
| 41 | + prerelease: false |
| 42 | + |
| 43 | + - name: Upload vsix |
| 44 | + id: upload-release-asset |
| 45 | + uses: actions/upload-release-asset@v1 |
| 46 | + env: |
| 47 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 48 | + with: |
| 49 | + upload_url: ${{ steps.create_github_release.outputs.upload_url }} |
| 50 | + asset_path: ./puppet-vscode-${{ steps.vsce.outputs.version }}.vsix |
| 51 | + asset_name: puppet-vscode-${{ steps.vsce.outputs.version }}.vsix |
| 52 | + asset_content_type: application/zip |
| 53 | + |
| 54 | + - name: Publish Extension |
| 55 | + id: publish-release-asset |
| 56 | + run: | |
| 57 | + npx vsce publish -p ${{ secrets.VSCE_TOKEN }} --packagePath ./puppet-vscode-${{ steps.vsce.outputs.version }}.vsix |
0 commit comments