ci: correction #362
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: build | |
on: | |
push: | |
branches: [ main ] | |
tags: [ v* ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
event_file: | |
name: "Event File" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Event File | |
path: ${{ github.event_path }} | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '20.x' | |
registry-url: https://registry.npmjs.org/ | |
- name: install | |
run: npm ci | |
- name: build package | |
run: npm run build | |
- name: test package | |
run: npm test | |
- name: Upload Test Results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Test Results | |
path: | | |
package/tests/.artifacts/results.xml | |
# - name: Publish Test Results | |
# uses: EnricoMi/publish-unit-test-result-action/composite@v2 | |
# if: always() | |
# with: | |
# files: | | |
# package/tests/.artifacts/results.xml | |
# publish to npm | |
- name: publish to npm | |
run: npm publish --access public --@sparser:registry=https://registry.npmjs.org/ | |
working-directory: ./package | |
if: startsWith(github.ref, 'refs/tags/v') | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# TODO: Changelog generation, version tagging |