Skip to content

feat: qlik api updates (#97) #58

feat: qlik api updates (#97)

feat: qlik api updates (#97) #58

Workflow file for this run

name: Publish NPM Package
on:
push:
tags:
- "v*.*.*"
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: Set NPM Token
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_CI_TOKEN }}" > .npmrc
- name: Set version and publish
run: |
VERSION=$(git describe --tags --abbrev=7 --match "v*")
VERSION=${VERSION#v}
echo "version is $VERSION"
jq --arg version "$VERSION" '.version = $version' package.json > temp.json && mv temp.json package.json
cat package.json
# Set the default user-agent.
ls ./chunks >/dev/null || (echo "Missing chunks directory!" && exit 1)
find ./chunks -type f -exec sed -i.bak -e "s;defaultUserAgent = \"qlik-api/latest\";defaultUserAgent = \"qlik-api/$VERSION\";g" -- {} +
rm -f ./chunks/*.bak
# Publish npm package
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_CI_TOKEN }}