-
Notifications
You must be signed in to change notification settings - Fork 22
108 lines (92 loc) · 3.39 KB
/
draft-release.yml
File metadata and controls
108 lines (92 loc) · 3.39 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
name: Draft Release
on:
push:
tags:
- "v*"
jobs:
build_release:
name: Build and Release
runs-on: macos-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 14.x
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Use NPM 7
run: npm install -g npm@7
- name: Install sha256sum
run: brew install coreutils
- 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: Build NPM tarballs
run: "npm pack --workspaces"
- 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: Checksum all artifacts
run: |
sha256sum --tag vrealize-developer-tools-$PKG_VERSION.vsix > vrealize-developer-tools-$PKG_VERSION.vsix.sha256
find *.tgz -type f -exec sha256sum --tag {} \; | sort > packages.sha256
env:
PKG_VERSION: ${{steps.version_step.outputs.version}}
- name: Sign VSIX checksum
uses: thomaso-mirodin/minisign-action@v1.1
with:
args: -Sm vrealize-developer-tools-$PKG_VERSION.vsix.sha256
minisign_key: ${{ secrets.RELEASE_MINISIGN_KEY }}
password: ${{ secrets.RELEASE_MINISIGN_PASS }}
env:
PKG_VERSION: ${{steps.version_step.outputs.version}}
- name: Sign packages checksum
uses: thomaso-mirodin/minisign-action@v1.1
with:
args: -Sm packages.sha256
minisign_key: ${{ secrets.RELEASE_MINISIGN_KEY }}
password: ${{ secrets.RELEASE_MINISIGN_PASS }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: vrealize-developer-tools-${{steps.version_step.outputs.version}}
path: |
*.tgz
packages.sha256
packages.sha256.minisig
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.minisig
- 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.0.2
with:
base-ref: ${{ env.baseRef }}
head-ref: ${{ github.ref }}
- name: Create a release
run: |
tagname="${GITHUB_REF#refs/tags/}"
gh release create "$tagname" --draft --notes $RELEASE_NOTES *.tgz *.vsix *.sha256 *.minisig
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
RELEASE_NOTES: ${{steps.generate_changelog.outputs.result}}