Skip to content

Merge branch 'release/v0.0.11' #21

Merge branch 'release/v0.0.11'

Merge branch 'release/v0.0.11' #21

Workflow file for this run

name: Deploy
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
outputs:
tag-pattern: ${{ steps.escape-tag-name.outputs.tag-pattern }}
steps:
- name: Install Node.js
uses: actions/setup-node@v4
- id: escape-tag-name
name: Escape Tag Name
run: |
npm install @stdlib/utils-escape-regexp-string --no-save
echo "tag-pattern=$(node -e "console.log(require('@stdlib/utils-escape-regexp-string')('${{ github.ref_name }}'))")" >> $GITHUB_OUTPUT
prerequisites:
name: Verify Prerequisites
uses: ./.github/workflows/prerequisites.yml
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
OVSX_TOKEN: ${{ secrets.OVSX_TOKEN }}
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
collect-changelog:
name: Collect Release Notes
runs-on: ubuntu-latest
needs:
- prepare
- prerequisites
outputs:
title: ${{ steps.release-info.outputs.title }}
notes: ${{ steps.release-info.outputs.notes }}
env:
TAG_PATTERN: ${{ needs.prepare.outputs.tag-pattern }}
ANY_PATTERN: /## \(.* \(v[0-9]*\|\[.*\]\)\)/
steps:
- uses: actions/checkout@v4
- name: Detect Current Changelog Entries
run: '[ ! -z "$(sed "$TAG_PATTERNp;d" CHANGELOG.md)" ] || { echo "No Changelog Entries Found!" && false; }'
- id: release-info
name: Collect Release Info
run: |
notes="$(sed "1,$TAG_PATTERN{ $TAG_PATTERNP ; d } ; $ANY_PATTERN,\$d" CHANGELOG.md)"
title="$(echo "$notes" | sed "2,\$d ; s$ANY_PATTERN\\\\1/")"
echo "notes=$notes"
echo "title=$title"
publish-npm:
name: Publish Package to NPM
uses: ./.github/workflows/npm-publish.yml
if: github.event_name == 'workflow_dispatch'
needs:
- collect-changelog
secrets:
npmToken: ${{ secrets.NPM_TOKEN }}
publish-gh:
name: Publish Package to GitHub Registry
uses: ./.github/workflows/npm-publish.yml
if: github.event_name == 'workflow_dispatch'
permissions:
packages: write
needs:
- collect-changelog
with:
registry: https://npm.pkg.github.com
secrets:
npmToken: ${{ secrets.GITHUB_TOKEN }}
release:
name: Create Release on GitHub
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
needs:
- collect-changelog
steps:
- name: Install Dependencies
run: npm clean-install
- name: Create NPM Packages
run: npm pack -w @typescript-nameof/nameof @typescript-nameof/types @typescript-nameof/babel @typescript-nameof/common @typescript-nameof/common-types
- name: Create `vscode` Extension
run: |
npm exec --workspace ./packages/vscode -- vsce package
npm run --prefix ./packages/vscode vscode:postpublish
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: ${{ needs.collect-changelog.outputs.title }}
body: ${{ needs.collect-changelog.outputs.notes }}
files: |
"*.tgz"
"packages/vscode/*.vsix"