mirror of
https://github.com/tenrok/axios.git
synced 2026-05-15 11:59:42 +03:00
7764844686
Bumps the github-actions group with 2 updates in the / directory: [actions/checkout](https://github.com/actions/checkout) and [ffurrer2/extract-release-notes](https://github.com/ffurrer2/extract-release-notes). Updates `actions/checkout` from 5 to 6 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) Updates `ffurrer2/extract-release-notes` from 2 to 3 - [Release notes](https://github.com/ffurrer2/extract-release-notes/releases) - [Changelog](https://github.com/ffurrer2/extract-release-notes/blob/main/CHANGELOG.md) - [Commits](https://github.com/ffurrer2/extract-release-notes/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: ffurrer2/extract-release-notes dependency-version: '3' dependency-type: direct:production update-type: version-update:semver-major 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>
86 lines
3.0 KiB
YAML
86 lines
3.0 KiB
YAML
name: Publish
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- closed
|
|
branches:
|
|
- main
|
|
- 'v**'
|
|
workflow_dispatch:
|
|
jobs:
|
|
publish:
|
|
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && github.event.pull_request.head.label == 'axios:release')
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
id-token: write
|
|
steps:
|
|
- name: "Release PR info"
|
|
if: github.event_name != 'workflow_dispatch'
|
|
run: echo "PR ${{ github.event.number }}"
|
|
- uses: actions/checkout@v6
|
|
- name: git config
|
|
run: |
|
|
git config user.name "${GITHUB_ACTOR}"
|
|
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 18
|
|
registry-url: https://registry.npmjs.org/
|
|
- run: npm ci
|
|
- run: npm run build
|
|
- name: get-npm-version
|
|
id: package-version
|
|
uses: martinbeentjes/npm-get-version-action@main
|
|
- name: Extract release notes
|
|
id: extract-release-notes
|
|
uses: ffurrer2/extract-release-notes@v3
|
|
- name: Check versions
|
|
run: node ./bin/check-build-version.js
|
|
############# TAG RELEASE ##############
|
|
- name: "Push tag v${{ steps.package-version.outputs.current-version }}"
|
|
uses: rickstaa/action-create-tag@v1
|
|
id: tag_version
|
|
with:
|
|
tag: "v${{ steps.package-version.outputs.current-version }}"
|
|
############# RESOLVE NPM TAG ##############
|
|
- name: NPM TAG
|
|
id: 'npm_tag'
|
|
run: node ./bin/resolveNPMTag.js
|
|
############# GITHUB RELEASE ##############
|
|
- name: "Create a GitHub release v${{ steps.package-version.outputs.current-version }}"
|
|
uses: ncipollo/release-action@v1
|
|
with:
|
|
tag: "v${{ steps.package-version.outputs.current-version }}"
|
|
name: "Release v${{ steps.package-version.outputs.current-version }}"
|
|
body: |
|
|
## Release notes:
|
|
${{ steps.extract-release-notes.outputs.release_notes }}
|
|
############# NPM RELEASE ##############
|
|
- name: Publish the release to NPM
|
|
run: npm publish --provenance --access public --tag ${{ steps.npm_tag.outputs.tag || 'latest' }}
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
|
notify:
|
|
needs: [publish]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
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@v6
|
|
with:
|
|
node-version: 18
|
|
cache: npm
|
|
- run: npm ci
|
|
############# Add release comments and tags to published PRs ##############
|
|
- name: Notify published PRs
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: node ./bin/actions/notify_published.js --tag ${{ github.event.inputs.tag || github.event.release.tag_name }}
|