Skip to content

chore: Release 6.1.1 (#840) #16

chore: Release 6.1.1 (#840)

chore: Release 6.1.1 (#840) #16

Workflow file for this run

# Version tags only
name: Publish
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
env:
# It'll work with secrets.GITHUB_TOKEN (which is provided by GitHub unconditionally)
# Still then release author would be "github-actions". It's better if it's dedicated repo bot
GITHUB_TOKEN: ${{ secrets.USER_GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Retrieve node_modules from cache
id: cacheNodeModules
uses: actions/cache@v4
with:
path: |
~/.npm
node_modules
key: npm-v18-${{ runner.os }}-refs/heads/master-${{ hashFiles('package.json') }}
- name: Install Node.js and npm
uses: actions/setup-node@v4
with:
node-version: 18.x
registry-url: https://registry.npmjs.org
- name: Publish new version
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish
# Note: No need to install dependencies as:
# 1. We have retrieved cached `node_modules` for very same `package.json`
# as stored with recent `master `build
# 2. If for some reason cache retrieval fails `npx` will download and install
# `github-release-from-cc-changelog`
- name: Publish release notes
run: |
TEMP_ARRAY=($(echo $GITHUB_REF | tr "/" "\n"))
TAG=${TEMP_ARRAY[@]: -1}
npx github-release-from-cc-changelog $TAG