-
Notifications
You must be signed in to change notification settings - Fork 22
114 lines (99 loc) · 4.01 KB
/
draft-release.yml
File metadata and controls
114 lines (99 loc) · 4.01 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Draft Release
on:
push:
tags:
- "v*"
jobs:
build_release:
name: Build and Release
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: echo github.ref
run: echo ${{ github.ref }}
- name: Use Node.js 12.x
uses: actions/setup-node@v2
with:
node-version: 12.x
- name: Get version number
id: version_step
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "::set-output name=version::${PACKAGE_VERSION}"
- name: Install dependencies
run: "npm ci"
- name: Build VSIX package
run: "node node_modules/gulp/bin/gulp.js package"
- name: Publish code coverage report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: "**/coverage/*.json"
yml: ./codecov.yml
flags: unittest
name: codecov
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v2
env:
GPG_PRIVATE_KEY: ${{ secrets.RELEASE_GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.RELEASE_GPG_PASSPHRASE }}
- name: Checksum and sign
run: |
sha256sum --tag vrealize-developer-tools-${version}.vsix > vrealize-developer-tools-${version}.vsix.sha256
gpg --default-key ${keyid} --armor --detach-sig vrealize-developer-tools-${version}.vsix.sha256
with:
version: ${{steps.version_step.outputs.version}}
keyid: ${{steps.import_gpg.outputs.keyid}}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: vrealize-developer-tools-${{steps.version_step.outputs.version}}
path: |
vrealize-developer-tools-${{steps.version_step.outputs.version}}.vsix
vrealize-developer-tools-${{steps.version_step.outputs.version}}.vsix.sha256
vrealize-developer-tools-${{steps.version_step.outputs.version}}.vsix.sha256.asc
- name: Get previous tag
run: |
PREV_TAG=$(git describe --abbrev=0 --tags "${{ github.ref }}^")
echo "baseRef=$PREV_TAG" >> $GITHUB_ENV
- name: Generate release notes
id: generate_changelog
uses: nblagoev/pull-release-notes-action@v1
with:
base-ref: ${{ env.baseRef }}
head-ref: ${{ github.ref }}
- name: Create release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ${{steps.generate_changelog.outputs.result}}
draft: true
prerelease: false
- name: Upload release asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./vrealize-developer-tools-${{steps.version_step.outputs.version}}.vsix
asset_name: vrealize-developer-tools-${{steps.version_step.outputs.version}}.vsix
asset_content_type: application/octet-stream
- name: Upload release checksum
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./vrealize-developer-tools-${{steps.version_step.outputs.version}}.vsix.sha256
asset_name: vrealize-developer-tools-${{steps.version_step.outputs.version}}.vsix.sha256
asset_content_type: application/octet-stream
- name: Upload release signature
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./vrealize-developer-tools-${{steps.version_step.outputs.version}}.vsix.sha256.asc
asset_name: vrealize-developer-tools-${{steps.version_step.outputs.version}}.vsix.sha256.asc
asset_content_type: application/octet-stream