feat(ref: no-ref): release #89
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 npm | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.get_version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org/ | |
- name: Build library | |
run: | | |
bun i | |
bun run build:lib | |
- name: Setup npm token | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.npm_token }}" > dist/ngx-mask-lib/.npmrc | |
- name: Publish library | |
run: bun publish:lib | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.npm_token}} | |
- name: Extract version | |
id: get_version | |
run: | | |
VERSION=$(node -p "require('./dist/ngx-mask-lib/package.json').version") | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
slack_notification: | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Post to a Slack channel | |
id: slack | |
uses: slackapi/[email protected] | |
with: | |
channel-id: 'deployments' | |
payload: | | |
{ | |
"text": "GitHub Action build result: ${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}", | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "GitHub Action build result: ${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}" | |
} | |
}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "Project: `${{ github.event.repository.name }}`" | |
} | |
}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "Version: `${{ needs.build.outputs.version || 'TBA' }}`" | |
} | |
}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "Commit/PR URL: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}" | |
} | |
}, | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "Website URL: ${{ secrets.NPM_PACKAGE_URL || 'TBA' }}" | |
} | |
} | |
] | |
} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |