Skip to content

Create Release

Create Release #8

Workflow file for this run

name: Create Release
# This uses the release-it repo to version bump and plublish
# See: https://github.com/release-it/release-it
# Below was initially blatenly copied from bot axios/axios and js-cookie/js-cookie
# See: https://github.com/axios/axios/blob/v1.x/.github/workflows/release.yml
# See: https://github.com/js-cookie/js-cookie/blob/main/.github/workflows/release.yml
# For the ROOt/.release-it.json file,
# See: https://github.com/js-cookie/js-cookie/blob/main/.release-it.json
on:
workflow_dispatch:
inputs:
version:
type: string
description: Semver version to use (format 1.1.1)
dry-run:
type: boolean
description: Perform dry-run
default: true
defaults:
run:
shell: bash
permissions:
contents: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- name: Git Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: chainguard-dev/actions/setup-gitsign@main
- name: Setup Git for commits.
run: |
git config --local user.name "github-actions[bot]"
# This email identifies the commit as GitHub Actions - see https://github.com/orgs/community/discussions/26560
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Create Release
uses: actions/setup-node@v3
with:
node-version: '18.x'
- run: |
npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
npm whoami
npm install
# See ROOt/.release-it.sh
# That defines how the release command behaves.
npm run release -- --ci --verbose ${{ github.event.inputs.version }}${{ github.event.inputs.dry-run == 'true' && ' --dry-run' || '' }}