Skip to content

⬆️ Bump globals from 16.5.0 to 17.7.0 #260

⬆️ Bump globals from 16.5.0 to 17.7.0

⬆️ Bump globals from 16.5.0 to 17.7.0 #260

Workflow file for this run

name: Test Release Publish
on: [push]
permissions:
contents: write
pull-requests: write
issues: write
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Get yarn cache
id: yarn-cache
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ubuntu-latest-node-20.18-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
ubuntu-latest-node-20.18-yarn-
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: '20.18'
registry-url: https://registry.npmjs.org/
- name: Install
run: yarn install
- name: Test
run: yarn test --ci --bail
- name: Test TypeScript Type Definitions
run: yarn test:typescript
- name: Build
run: NODE_ENV=production yarn build
release_publish:
name: Release to Github and publish to NPM
runs-on: ubuntu-latest
needs: test
if: success() && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Get yarn cache
id: yarn-cache
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ubuntu-latest-node-20.18-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
ubuntu-latest-node-20.18-yarn-
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: '20.18'
registry-url: https://registry.npmjs.org/
- name: Install
run: yarn install
- name: Build
run: NODE_ENV=production yarn build
- name: Setup env vars
id: ownEnvVars
run: |
# Set PACKAGE_VERSION
PACKAGE_VERSION=$(node -p -e "require('./package.json').version")
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
# Set COMMIT_LOG
COMMIT_LOG=`git log $(git describe --tags --abbrev=0)..HEAD --format='%s - %an'`
echo "COMMIT_LOG=$COMMIT_LOG" >> $GITHUB_ENV
- uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1
with:
# token: ${{ secrets.GITHUB_TOKEN }} # no need for personal token
tag: ${{ env.PACKAGE_VERSION }}
commit: main
body: ${{ env.COMMIT_LOG }}
- name: npm publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}