Skip to content

Commit 3b5fcbf

Browse files
committed
Adds CD workflow (wip)
1 parent 9ec06fb commit 3b5fcbf

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/cd-stable.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
on:
2+
push:
3+
tags:
4+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
5+
6+
name: Publish Stable
7+
8+
jobs:
9+
build:
10+
name: Publish Stable
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
- name: Setup node
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: '12.x'
19+
- name: Setup Environment
20+
run: node -e "console.log(`PACKAGE_VERSION=${require('./package.json').version}\nPACKAGE_NAME=${require('./package.json').name}-v${require('./package.json').version}`)" >> $GITHUB_ENV
21+
- name: Verify versions
22+
run: node -e "if ('refs/tags/v' + ${{ env.PACKAGE_VERSION }} !== '${{ github.ref }}') { console.log('::error' + 'Version Mismatch. refs/tags/v' + ${{ env.PACKAGE_VERSION }}, '${{ github.ref }}'); throw Error('Version Mismatch')} "
23+
- name: Install
24+
run: yarn
25+
- name: Package extension
26+
run: yarn run pack
27+
# - name: Publish Extension
28+
# run: npx vsce publish --packagePath ./${{ env.PACKAGE_NAME }}.vsix -p ${{ secrets.MARKETPLACE_PAT }}
29+
- name: Generate Changelog
30+
id: changelog
31+
uses: mindsers/changelog-reader-action@v2
32+
with:
33+
validation_depth: 10
34+
version: ${{ env.PACKAGE_VERSION }}
35+
path: ./CHANGELOG.md
36+
- name: Create GitHub release
37+
id: create_release
38+
uses: actions/create-release@v1
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
with:
42+
tag_name: ${{ github.ref }}
43+
release_name: v${{ env.PACKAGE_VERSION }}
44+
body: ${{ steps.changelog.outputs.changes }}
45+
draft: true
46+
prerelease: false
47+
- name: Upload GitHub release
48+
id: upload-release-asset
49+
uses: actions/upload-release-asset@v1
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
with:
53+
upload_url: ${{ steps.create_release.outputs.upload_url }}
54+
asset_path: ./${{ env.PACKAGE_NAME }}.vsix
55+
asset_name: ${{ env.PACKAGE_NAME }}.vsix
56+
asset_content_type: application/zip

0 commit comments

Comments
 (0)