more tests #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish packages | |
on: | |
push: | |
branches: | |
- master | |
# Add this at the top level to ensure we have proper permissions | |
permissions: | |
contents: write | |
packages: write # Add this if you're using GitHub Packages | |
id-token: write # Add this for better security with secrets | |
jobs: | |
publish_packages: | |
runs-on: ubuntu-latest | |
environment: prod | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Verify Secret Availability | |
run: | | |
if [ -z "${{ secrets.NPM_TOKEN }}" ]; then | |
echo "NPM_TOKEN secret is not set" | |
exit 1 | |
else | |
echo "NPM_TOKEN secret is available" | |
fi | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
cache: "npm" | |
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: Configure NPM Authentication | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc | |
cat .npmrc |