1.4.0 #120
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: CD | |
on: | |
push: | |
branches: | |
'*' | |
tags: | |
# This excludes tags from CD, as they should be published through a release. | |
'!v*' | |
env: | |
CI: true | |
jobs: | |
publish-npm: | |
runs-on: ubuntu-22.04 | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Prepare for publication to npm | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
registry-url: 'https://registry.npmjs.org' | |
scope: '@inrupt' | |
- name: Determine npm tag | |
# Remove non-alphanumeric characters | |
# See https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable | |
run: echo "TAG_SLUG=$(echo ${GITHUB_REF#refs/heads/} | tr -cd '[:alnum:]-')" >> $GITHUB_ENV | |
- run: npm ci | |
- name: Prepare prerelease version | |
run: | | |
git config user.name $GITHUB_ACTOR | |
git config user.email gh-actions-${GITHUB_ACTOR}@github.com | |
# Make sure the prerelease is tagged with the branch name, and that they are sorted by build: | |
npm version prerelease --preid=$TAG_SLUG-$GITHUB_RUN_ID-$GITHUB_RUN_NUMBER | |
- name: Publish an npm tag for this branch | |
run: npm publish --access public --tag "$TAG_SLUG" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.INRUPT_NPM_TOKEN }} | |
- run: | | |
echo "Package published. To install, run:" | |
echo "" | |
echo " npm install @inrupt/solid-common-vocab@$TAG_SLUG" |