Skip to content

v0.1.0

v0.1.0 #15

Workflow file for this run

name: Publish Package
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "Dist-tag to publish under (e.g. latest, beta)"
required: false
default: "latest"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v5
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
- run: bun install --frozen-lockfile
- name: Determine dist-tag
id: dist-tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "tag=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT"
elif [ "${{ github.event.release.prerelease }}" = "true" ]; then
echo "tag=beta" >> "$GITHUB_OUTPUT"
else
echo "tag=latest" >> "$GITHUB_OUTPUT"
fi
- run: npm publish --access public --tag ${{ steps.dist-tag.outputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Notify Slack
if: success()
uses: slackapi/slack-github-action@v2.1.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: "📦 `@codewithbeto/ship@${{ steps.dist-tag.outputs.tag }}` published to npm\nVersion: `${{ github.event.release.tag_name || 'manual' }}`\nTag: `${{ steps.dist-tag.outputs.tag }}`"