-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (41 loc) · 1.45 KB
/
cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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"