2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00
Files
axios/.github/workflows/release-branch.yml
T
dependabot[bot] b2890f8efb chore(deps): bump the github-actions group with 3 updates (#10785)
Bumps the github-actions group with 3 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact), [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) and [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action).


Updates `actions/upload-artifact` from 7.0.0 to 7.0.1
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/bbbca2ddaa5d8feaa63e36b76fdaad77386f024f...043fb46d1a93c77aae656e7c1c64a875d1fc6a0a)

Updates `peter-evans/create-pull-request` from 8.1.0 to 8.1.1
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/c0f553fe549906ede9cf27b5156039d195d2ece0...5f6978faf089d4d20b00c7766989d076bb2fc7f1)

Updates `zizmorcore/zizmor-action` from 0.5.2 to 0.5.3
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](https://github.com/zizmorcore/zizmor-action/compare/71321a20a9ded102f6e9ce5718a2fcec2c4f70d8...b1d7e1fb5de872772f31590499237e7cce841e8e)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: peter-evans/create-pull-request
  dependency-version: 8.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.5.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jay <jasonsaayman@gmail.com>
2026-04-21 20:18:37 +02:00

311 lines
11 KiB
YAML

name: Create release branch
on:
workflow_dispatch:
inputs:
type:
type: choice
description: Choose release type
options:
- patch
- minor
- major
default: patch
beta:
type: boolean
description: Prerelease
default: false
permissions:
contents: read
jobs:
build-and-run-vitest:
name: Build and run vitest
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24.x
cache: npm
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Build project
run: npm run build
- name: Install Playwright with deps
run: npx playwright install --with-deps
- name: Run unit tests
run: npm run test:vitest:unit
- name: Run browser tests
run: npm run test:vitest:browser:headless
- name: Pack npm tarball
run: npm pack
- name: Upload npm pack artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: axios-tarball
path: axios-*.tgz
if-no-files-found: error
retention-days: 1
cjs-smoke-tests:
name: CJS smoke tests (Node ${{ matrix.node-version }})
needs: build-and-run-vitest
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [12, 14, 16, 18]
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: tests/smoke/cjs/package-lock.json
- name: Download npm pack artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: axios-tarball
path: artifacts
- name: Install CJS smoke test dependencies
working-directory: tests/smoke/cjs
run: npm install --ignore-scripts
- name: Install packed axios
working-directory: tests/smoke/cjs
run: npm install --no-save ../../../artifacts/axios-*.tgz
- name: Run CJS smoke tests
working-directory: tests/smoke/cjs
run: npm run test:smoke:cjs:mocha
esm-smoke-tests:
name: ESM smoke tests (Node ${{ matrix.node-version }})
needs: build-and-run-vitest
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [20, 22, 24]
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: tests/smoke/esm/package-lock.json
- name: Download npm pack artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: axios-tarball
path: artifacts
- name: Install ESM smoke test dependencies
working-directory: tests/smoke/esm
run: npm install --ignore-scripts
- name: Install packed axios
working-directory: tests/smoke/esm
run: npm install --no-save ../../../artifacts/axios-*.tgz
- name: Run ESM smoke tests
working-directory: tests/smoke/esm
run: npm run test:smoke:esm:vitest
cjs-module-tests:
name: CJS module tests (Node ${{ matrix.node-version }})
needs: build-and-run-vitest
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [12, 14, 16, 18]
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: tests/module/cjs/package-lock.json
- name: Download npm pack artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: axios-tarball
path: artifacts
- name: Install CJS module test dependencies
working-directory: tests/module/cjs
run: npm install --ignore-scripts
- name: Install packed axios
working-directory: tests/module/cjs
run: npm install --no-save ../../../artifacts/axios-*.tgz
- name: Run CJS module tests
working-directory: tests/module/cjs
run: npm run test:module:cjs
esm-module-tests:
name: ESM module tests (Node ${{ matrix.node-version }})
needs: build-and-run-vitest
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [20, 22, 24]
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup node
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: tests/module/esm/package-lock.json
- name: Download npm pack artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: axios-tarball
path: artifacts
- name: Install ESM module test dependencies
working-directory: tests/module/esm
run: npm install --ignore-scripts
- name: Install packed axios
working-directory: tests/module/esm
run: npm install --no-save ../../../artifacts/axios-*.tgz
- name: Run ESM module tests
working-directory: tests/module/esm
run: npm run test:module:esm
bun-smoke-tests:
name: Bun smoke tests
needs: build-and-run-vitest
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
- name: Download npm pack artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: axios-tarball
path: artifacts
- name: Install packed axios
env:
TMPDIR: ${{ runner.temp }}
BUN_INSTALL_CACHE_DIR: ${{ runner.temp }}/bun-cache
run: |
mkdir -p "$BUN_INSTALL_CACHE_DIR"
mv artifacts/axios-*.tgz artifacts/axios.tgz
cd tests/smoke/bun
bun add file:../../../artifacts/axios.tgz
- name: Run Bun smoke tests
working-directory: tests/smoke/bun
run: bun test
deno-smoke-tests:
name: Deno smoke tests
needs: build-and-run-vitest
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup deno
uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4
- name: Download npm pack artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: axios-tarball
path: artifacts
- name: Prepare packed axios dist
run: mkdir -p dist && tar -xzf artifacts/axios-*.tgz -C artifacts && cp -R artifacts/package/dist/. ./dist
- name: Install Deno smoke test dependencies
working-directory: tests/smoke/deno
run: deno install
- name: Run Deno smoke tests
working-directory: tests/smoke/deno
run: deno task test
bump-version-and-create-pr:
name: Bump version and create PR
needs:
[build-and-run-vitest, cjs-smoke-tests, esm-smoke-tests, bun-smoke-tests, deno-smoke-tests]
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24.x
cache: npm
- name: Install dependencies
run: npm ci --ignore-scripts
- 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 }}
INPUT_TYPE: ${{ github.event.inputs.type }}
INPUT_BETA: ${{ github.event.inputs.beta }}
id: bump-version
run: |
TYPE="${INPUT_TYPE}"
BETA="${INPUT_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
VERSION=$(node -p "require('./package.json').version")
echo "newTag=$VERSION" >> "$GITHUB_OUTPUT"
echo "newBranch=release-v1x/version-$VERSION" >> "$GITHUB_OUTPUT"
- name: Run preversion
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run preversion
- name: Build project
run: npm run build
- name: Create Pull Request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
branch: ${{ steps.bump-version.outputs.newBranch }}
base: v1.x
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