Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
paths:
- 'package.json'

permissions:
id-token: write
contents: read

jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -14,12 +18,15 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '14.x'
node-version: '20'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need to test to confirm that this works with node 20.

registry-url: 'https://registry.npmjs.org'
scope: '@rancher'

# Ensure npm 11.5.1 or later is installed
- name: Update npm
run: npm install -g npm@latest

- name: script
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
git config --global user.name 'Rancher Icons'
git config --global user.email '[email protected]'
Expand Down
30 changes: 14 additions & 16 deletions publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,24 @@ else
pushd ${UPLOAD}
fi

# Publish to npm if a node auth token is set in the environment
if [ -n "${NODE_AUTH_TOKEN}" ]; then
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why we originally had this conditional clause for publishing. We might need to do some debugging to find the proper environment variable for the trusted publishing method if we need this back.

echo "Publishing @rancher/icons to npm"
# Publish to npm
echo "Publishing @rancher/icons to npm"

pwd
pushd ${DIST}
pwd
ls -al

PUBLISH_ARGS="--no-git-tag-version --access public"
pwd
pushd ${DIST}
pwd
ls -al

yarn publish . --new-version ${VERSION} ${PUBLISH_ARGS}
RET=$?
PUBLISH_ARGS="--no-git-tag-version --access public"

popd
yarn publish . --new-version ${VERSION} ${PUBLISH_ARGS}
RET=$?

if [ $RET -ne 0 ]; then
echo "Error publishing @rancher/icons package to npm"
exit $RET
fi
popd

if [ $RET -ne 0 ]; then
echo "Error publishing @rancher/icons package to npm"
exit $RET
fi

# Update the dist branch - this is the latest build of the icon font
Expand Down