forked from snyk/vscode-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (73 loc) · 2.62 KB
/
release-stable.yaml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Build and Release
on:
workflow_dispatch:
schedule:
- cron: '0 9 * * 2' # every Tuesday at 9 am UTC
jobs:
build:
uses: snyk/vscode-extension/.github/workflows/ci.yaml@main
secrets:
ITERATIVELY_KEY: ${{ secrets.ITERATIVELY_KEY }}
publish:
runs-on: ubuntu-latest
needs: build
environment: Stable
name: Publish extension
outputs:
new-version: ${{ steps.patched-tag.outputs.new_version }}
new-tag: ${{ steps.patched-tag.outputs.new_tag }}
steps:
- name: Fetch sources
uses: actions/checkout@v2
- name: Setup VSCE
run: sudo npm install -g vsce@latest
- name: Install dependencies
run: npm ci
- name: Verify analytics events
run: npm run ampli:verify -- -t ${{ secrets.ITERATIVELY_KEY }}
- name: Bump patch version
id: patched-tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: main
default_bump: patch
- name: Add Credentials
run: |
sed -i \
-e 's|${env.SNYK_VSCE_SEGMENT_WRITE_KEY}|${{ secrets.SNYK_VSCE_SEGMENT_WRITE_KEY }}|g' \
-e 's|${env.SNYK_VSCE_AMPLITUDE_EXPERIMENT_API_KEY}|${{ secrets.SNYK_VSCE_AMPLITUDE_EXPERIMENT_API_KEY }}|g' \
-e 's|${env.SNYK_VSCE_SENTRY_DSN_KEY}|${{ secrets.SNYK_VSCE_SENTRY_DSN_KEY }}|g' \
snyk.config.json
- name: Publish to Marketplace
run: vsce publish -p ${{ secrets.MARKETPLACE_TOKEN }} --no-update-package-json ${{ steps.patched-tag.outputs.new_version }}
release:
runs-on: ubuntu-latest
needs: publish
environment: Stable
name: Release
steps:
- name: Fetch sources
uses: actions/checkout@v2
- name: Setup VSCE
run: sudo npm install -g vsce@latest
- name: Install dependencies
run: npm ci
- name: Package VSIX
run: echo y | vsce package --no-git-tag-version --no-update-package-json ${{ needs.publish.outputs.new-version }}
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1
- name: Create release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ needs.publish.outputs.new-tag }}
tag_name: ${{ needs.publish.outputs.new-tag }}
body: '${{ steps.extract-release-notes.outputs.release_notes }}'
draft: false
prerelease: false
fail_on_unmatched_files: true
files: |
**/*.vsix