Skip to content

chore(release): freeRASP 6.3.1 #13

chore(release): freeRASP 6.3.1

chore(release): freeRASP 6.3.1 #13

name: Publish new release
on:
pull_request:
types: [closed]
branches:
- 'master'
push:
tags:
- 'v*'
jobs:
release_gh:
name: Create new GitHub release
if: contains(github.event.pull_request.labels.*.name, 'release')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Generate Changelog
run: node ./scripts/extract_changelog.js > ${{ github.workspace }}-CURRENT_CHANGELOG.md
- name: Get latest version
run: echo "PACKAGE_VERSION=$(node scripts/extract_version.js)" >> $GITHUB_ENV
- name: GitHub Release
uses: softprops/action-gh-release@v2
with:
name: freeRASP ${{ env.PACKAGE_VERSION }}
tag_name: v${{ env.PACKAGE_VERSION }}
body_path: ${{ github.workspace }}-CURRENT_CHANGELOG.md
publish_npmjs:
name: Publish release to npm.js
needs: release_gh
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
node-version-file: .nvmrc
- name: Cache npm dependencies
id: npm-cache
uses: actions/cache@v4
with:
path: '~/.npm'
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
shell: bash
- name: Compile .ts files
run: npx tsc
shell: bash
- name: Configure git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Publish package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}