axios-axios/.github/workflows/release.yml
Dmitriy Mozgovoy 46085e6ffc
chore(ci): fix release action;
* chore(ci): Add release-it script;
* fix(utils): redesigned logic for obtaining the global link;;
* chore(git): updated .gitignore;
chore(npm): updated .npmignore;
* chore(git): fix husky prepare script;
* chore(github): reworked npm release action step;
* chore(ci): add CHANGELOG.md contributors section generator;
* chore(deps): add `auto-changelog` to package.json;
2022-12-20 20:45:24 +02:00

58 lines
1.7 KiB
YAML

name: Release Axios
on:
workflow_dispatch:
inputs:
type:
type: choice
description: Choose release type
options:
- auto
- patch
- minor
- major
default: auto
beta:
type: boolean
description: Prerelease
default: false
npm:
type: boolean
description: NPM release
default: true
dry:
type: boolean
description: Dry release
default: false
jobs:
releaseIt:
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: npm credentials
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
- run: npm install
- name: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TYPE_ARG: ${{ fromJSON('{"auto":"", "patch":"--patch", "minor":"--minor", "major":"--major"}')[github.event.inputs.type] }}
BETA_ARG: ${{ github.event.inputs.beta == 'true' && '--preRelease=beta' || '' }}
DRY_ARG: ${{ github.event.inputs.dry == 'true' && '--dry-run' || '' }}
run: npm run release -- --ci --verbose $TYPE_ARG $BETA_ARG $DRY_ARG
- name: npm-release
if: ${{ github.event.inputs.dry == 'false' && github.event.inputs.npm == 'true' }}
run: npm publish