Skip to content

ci: Add debugging step in npm-release.yml #3

ci: Add debugging step in npm-release.yml

ci: Add debugging step in npm-release.yml #3

Workflow file for this run

name: Build and Publish to NPM
on:
push:
tags:
- '*'
jobs:
npm-release:
if: startsWith(github.ref, 'refs/tags/')
name: Release Fruzhin-web to NPM.
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up cache for Gradle
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'corretto'
- name: Build Gradle Project
run: ./gradlew build
- name: Set version from tag
id: version
run: |
VERSION=${GITHUB_REF_NAME}
echo "Releasing version: $VERSION"
sed -i -e 's@version = .\d*.\d*.\d*.*@version = "'"$VERSION"'"@g' build.gradle.kts
- name: Unzip WAR file
run: |
mkdir -p dist
unzip build/libs/*.war -d temp_unzip
mv temp_unzip/* dist/
rm -rf dist/META-INF dist/WEB-INF dist/index.html
# Set up Node.js for NPM
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
# Install NPM dependencies
- name: Install NPM dependencies
run: npm install
# Login to NPM
- name: Login to NPM
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
# Publish to NPM
- name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish