2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-05 16:42:32 +03:00
Files
axios/.github/workflows/release-branch.yml
T
2026-01-27 08:04:06 +02:00

80 lines
2.3 KiB
YAML

name: Create release branch
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
permissions:
contents: write
pull-requests: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Configure git identity
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Bump version with NPM version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: bump-version
run: |
TYPE=${{ github.event.inputs.type }}
BETA=${{ github.event.inputs.beta }}
if [ "$TYPE" = "auto" ]; then
npm version $(npm version | grep -Eo 'patch|minor|major' | head -1)
else
if [ "$BETA" = "true" ]; then
npm version $TYPE --preid=beta
else
npm version $TYPE
fi
fi
echo "::set-output name=newTag::$(node -p "require('./package.json').version")"
- name: Build project
run: npm run build
- name: Run unit tests
run: npm run test:node
- name: Run package tests
run: npm run test:package
- name: Run browser tests
run: npm run test:browser
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
with:
branch: "release"
commit-message: "chore(release): prepare release ${{ steps.bump-version.outputs.newTag }}"
body: "This PR prepares the release ${{ steps.bump-version.outputs.newTag }}."
title: "chore(release): prepare release ${{ steps.bump-version.outputs.newTag }}"
maintainer-can-modify: true
draft: false
labels: |
type::automated-pr
priority::high
commit::chore