chore(release): pulling release/1.5.2 into master #29
Workflow file for this run
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: Deploy to NPM | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: ['master'] | |
types: | |
- closed | |
permissions: | |
id-token: write # allows the JWT to be requested from GitHub's OIDC provider | |
contents: read # This is required for actions/checkout | |
env: | |
NODE_OPTIONS: "--no-warnings" | |
jobs: | |
deploy-tag: | |
name: Deploy to NPM | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/master') || github.event.pull_request.merged == true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Install Dependencies | |
env: | |
HUSKY: 0 | |
run: npm run setup | |
- name: Get new version number & date | |
run: | | |
current_version=$(jq -r .version package.json) | |
echo "CURRENT_VERSION_VALUE=$current_version" >> $GITHUB_ENV | |
echo "DATE=$(date)" >> $GITHUB_ENV | |
- name: Publish package to NPM | |
env: | |
HUSKY: 0 | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NPM_CONFIG_PROVENANCE: true | |
run: | | |
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} | |
npm run build | |
npm run release:ci | |
- name: Send message to Slack channel | |
id: slack | |
uses: slackapi/[email protected] | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
PROJECT_NAME: 'Rudder Typer NPM Package' | |
NPM_PACKAGE_URL: 'https://www.npmjs.com/package/rudder-typer' | |
with: | |
channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }} | |
payload: | | |
{ | |
"blocks": [ | |
{ | |
"type": "header", | |
"text": { | |
"type": "plain_text", | |
"text": "New release: ${{ env.PROJECT_NAME }}" | |
} | |
}, | |
{ | |
"type": "divider" | |
}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "*Release: <${{ env.NPM_PACKAGE_URL }}|${{ env.CURRENT_VERSION_VALUE }}>*\n${{ env.DATE }}" | |
} | |
} | |
] | |
} |