Create Release #1
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: 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: choice | |
description: Semver version to use | |
options: | |
- patch | |
- minor | |
- major | |
default: patch | |
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 }} | |
NPM_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 i | |
# 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' || '' }} |