forked from vercel/pkg-fetch
-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
76bc9d0
commit d1b15b3
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# ######################################################################### | ||
# Creates a new release using `workflow_dispatch` event trigger with `type` | ||
# as input to describe the type of release to create | ||
name: 'Release-it: Create a new release on demand' | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
type: | ||
description: 'Type/Options. `major --preRelease=beta`, `--preRelease`, `major`, `patch`, `minor` or `major`' | ||
required: false | ||
default: 'patch' | ||
|
||
jobs: | ||
release: | ||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
runs-on: [ubuntu-latest] | ||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
steps: | ||
- name: Checkout main | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: 'main' | ||
fetch-depth: 0 # fetch all commits history to create the changelog | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'yarn' | ||
|
||
- name: Install dependencies | ||
run: yarn install --ignore-engines | ||
|
||
- name: Initialize Git user | ||
run: | | ||
git config --global user.email "${{ github.actor }}@users.noreply.github.com }}" | ||
git config --global user.name "${{ github.actor }}" | ||
- name: Initialize NPM config | ||
run: | | ||
npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Make the release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
# When all commits since the latest major tag should be added to the changelog, use --git.tagExclude='*[-]*' | ||
npx release-it ${{github.event.inputs.type}} --git.tagExclude='*[-]*' --ci --verbose |