Skip to content

Manual Release Publish #28

Manual Release Publish

Manual Release Publish #28

Workflow file for this run

---
name: Manual Release Publish
on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'The new version to create.'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
- prepatch
- preminor
- premajor
- prerelease
npmTag:
description: 'NPM tag. Defaults to "latest".'
required: true
default: 'latest'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
HUSKY: '0'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
ref: 'main'
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: pnpm/action-setup@v4
with:
run_install: false
- name: Package Manager Setup
run: |
pnpm set registry "https://registry.npmjs.org/"
pnpm set //registry.npmjs.org/:_authToken $NPM_TOKEN
pnpm whoami
- name: Git Setup
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com'"
git config --global user.name "Zutron Release Bot"
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Create Release and Tags
shell: bash
run: pnpm turbo-version -b ${{inputs.releaseVersion}}
- name: Publish to NPM
shell: bash
run: pnpm publish -r --tag ${{inputs.npmTag}}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Push Tags and Commits
shell: bash
run: |
git push --tags && git push
RELEASE_TAG = $(git describe --tags $(git rev-list --tags --max-count=1))
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: ${{ github.workspace }}/packages/zutron/CHANGELOG.md
repository: goosewobbler/zutron
tag_name: $RELEASE_TAG
# note you'll typically need to create a personal access token
# with permissions to create releases in the other repo
token: ${{ secrets.GITHUB_TOKEN }}