Bump the all-npm-packages group with 4 updates #11
Workflow file for this run
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: Make a release | |
on: | |
workflow_dispatch: # can be triggered manually | |
push: | |
tags: | |
- "v*.*.*" | |
pull_request: # and for PRs (dry-run) | |
permissions: | |
contents: write | |
jobs: | |
Release: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
name: Checkout repository | |
- name: Set version string to the commit hash | |
run: echo "RELEASE_VERSION=${{ github.sha }}" >> "$GITHUB_ENV" | |
- name: Set version string based on trigger (ref_name if on tag) | |
run: echo "RELEASE_VERSION=${{ github.ref_name }}" >> "$GITHUB_ENV" | |
if: startsWith(github.ref, 'refs/tags/') | |
- name: Set version string based on trigger (PR number if a PR) | |
run: echo "RELEASE_VERSION=${{ github.event.pull_request.number }}" >> "$GITHUB_ENV" | |
if: github.event_name == 'pull_request' | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- run: npm install | |
- run: xvfb-run -a npm test | |
- run: npm test | |
- name: Publish | |
if: success() && startsWith(github.ref, 'refs/tags/') | |
run: npm run deploy | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
# See https://github.com/softprops/action-gh-release | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
name: ${RELEASE_VERSION} | |
draft: false | |
prerelease: false | |
generate_release_notes: true |