9.0.5 #352
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: test & publish | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
sentencecase: ['on+guess', 'on', 'off'] | |
caseprotection: [ 'as-needed', 'strict', 'off' ] | |
preservequoted: [ 'false', 'true' ] | |
steps: | |
- uses: actions/checkout@v4 | |
- run: echo "::version="`jq -r .version package.json` >> $GITHUB_OUTPUT | |
id: version | |
- name: cancel spurious build on tagged version | |
uses: andymckay/cancel-action@master | |
if: github.event.head_commit.message == steps.version.outputs.version && !startsWith(github.ref, 'refs/tags/') | |
- name: install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Cache node dependencies | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-dependencies | |
with: | |
path: | | |
~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }} | |
- run: | | |
npm install | |
echo '{"sentenceCase": "${{ matrix.sentencecase }}", "caseProtection": "${{ matrix.caseprotection }}", "preserveQuoted": ${{ matrix.preservequoted }}, "big": true}' > test/runtests.json | |
npm test -- --color | |
release: | |
runs-on: ubuntu-latest | |
needs: test | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Cache node dependencies | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-dependencies | |
with: | |
path: | | |
~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }} | |
- name: install node dependencies | |
run: npm install | |
- name: Publish | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
access: public |