Skip to content

Release + Publish

Release + Publish #11

Workflow file for this run

name: Release + Publish
on:
workflow_dispatch:
inputs:
versionChange:
type: choice
description: Select the version change
required: true
default: 'minor'
options:
- major
- minor
- patch
jobs:
release:
runs-on: ubuntu-latest
env:
VERSION_CHANGE: ${{ github.event.inputs.versionChange }}
permissions:
contents: write
id-token: write
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Platform πŸ› 
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.1.17
- name: Install dependencies πŸ“¦
run: |
bun install --frozen-lockfile
bun add -g npm
- name: Update version β†—
run: |
git config --global user.name 'Philipp Kief'
git config --global user.email 'PKief@users.noreply.github.com'
git config --global push.followTags true
npm version ${{ env.VERSION_CHANGE }} -m "Release %s"
- name: Get meta data πŸ”
run: |
VERSION=$(bun --print "(await import('./package.json')).version")
NAME=$(bun --print "(await import('./package.json')).name")
DISPLAY_NAME=$(bun --print "(await import('./package.json')).displayName")
echo VERSION=$VERSION >> $GITHUB_ENV
echo NAME=$NAME >> $GITHUB_ENV
echo DISPLAY_NAME=$DISPLAY_NAME >> $GITHUB_ENV
- name: Build βš’οΈ
run: bun run build
- name: Push tags πŸ“Œ
run: git push
- name: Release ${{ env.VERSION }} πŸ”†
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.VERSION }}
name: ${{ env.DISPLAY_NAME }} v${{ env.VERSION }}
generate_release_notes: true
- name: Publish to NPM Registry 🌐
run: |
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
npm publish --provenance --access public