Skip to content

Commit

Permalink
Adds publishing step to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
joaobispo committed Dec 30, 2024
1 parent 951542f commit fdd3f9e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,26 @@ jobs:
run: |
cd clava/Clava-JS
npm run test
# Only on ubuntu-latest
- name: Publish JS
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
run: |
echo "Attempt to publish while running on {{ matrix.os }} and Node.js {matrix.node-version}"
if [[ "${{ github.event_name }}" == "push" ]]; then
if [ "${{ github.ref }}" == "refs/heads/staging" ]; then
echo "Publishing from staging, creating timestamped prerelease and updating tag 'staging'"
TIMESTAMP=$(date +"%Y%m%d%H%M%S")
npm version prerelease --preid="$TIMESTAMP"
npm publish --tag staging --access public
elif [ "${{ github.ref }}" == "refs/heads/master" ]; then
echo "Publishing from main, incrementing patch version before publishing"
npm version patch
npm publish
git push # Push updated version
fi
else
echo "Not a push event, skipping publish."
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit fdd3f9e

Please sign in to comment.