Draft Release #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Draft Release | |
on: | |
workflow_dispatch: | |
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 19.6.0 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 19.6.0 | |
- name: Use NPM 9.4.0 | |
run: npm install -g [email protected] # lock to 9.4.0 until actions/setup-node#411 and npm/cli#4341 are fixed | |
- name: Install sha256sum and minisign | |
run: | | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
(echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/runner/.bashrc | |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | |
brew update | |
brew install coreutils minisign | |
- name: Get version number | |
id: version_step | |
run: | | |
PACKAGE_VERSION=$(node -p "require('./package.json').version") | |
echo "version=${PACKAGE_VERSION}" >> "$GITHUB_OUTPUT" | |
- 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 and sign 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 | |
printf "$MINISIGN_KEY" > minisign.key | |
echo $MINISIGN_PASSWORD | minisign -s minisign.key -Sm vrealize-developer-tools-$PKG_VERSION.vsix.sha256 | |
echo $MINISIGN_PASSWORD | minisign -s minisign.key -Sm packages.sha256 | |
env: | |
PKG_VERSION: ${{steps.version_step.outputs.version}} | |
MINISIGN_KEY: ${{ secrets.RELEASE_MINISIGN_KEY }} | |
MINISIGN_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/[email protected] | |
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}} |