Skip to content

Commit

Permalink
Merge branch 'v1.x' into fix/5657
Browse files Browse the repository at this point in the history
  • Loading branch information
WillianAgostini committed Jan 8, 2024
2 parents a067260 + 6d4c421 commit 399771e
Show file tree
Hide file tree
Showing 57 changed files with 2,637 additions and 1,136 deletions.
26 changes: 24 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -15,16 +15,38 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 18.x]
node-version: [12.x, 14.x, 16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
persist-credentials: true
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
- name: Check changes
id: changed-ignored
uses: tj-actions/changed-files@v40
with:
files: |
**.md
sandbox/**
examples/**
.github/**
templates/**
bin/**
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
if: steps.changed-ignored.outputs.only_modified == 'false'
- run: npm ci
if: steps.changed-ignored.outputs.only_modified == 'false'
- run: npm test
if: steps.changed-ignored.outputs.only_modified == 'false'
51 changes: 51 additions & 0 deletions .github/workflows/notify.yml
@@ -0,0 +1,51 @@
name: notify

on:
#workflow_run:
# workflows: ["publish"]
# types:
# - completed
#repository_dispatch:
# types: [ notify ]
#release:
# types: [published]
# branches:
# - main
# - 'v**'
#push:
# tags:
# - 'v[0-9]+.[0-9]+.[0-9]+'
# branches:
# - main
# - 'v**'

workflow_dispatch:
inputs:
tag:
required: false
jobs:
notify:
runs-on: ubuntu-latest
#if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
steps:
#- name: Dump GitHub context
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
# run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v3
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: 18
cache: npm
- run: npm ci
- 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 }}
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Expand Up @@ -35,9 +35,9 @@ jobs:
- name: Prepare release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TYPE_ARG: ${{ fromJSON('{"auto":"", "patch":"--patch", "minor":"--minor", "major":"--major"}')[github.event.inputs.type] }}
TYPE_ARG: ${{ fromJSON('{"auto":"", "patch":"patch", "minor":"minor", "major":"major"}')[github.event.inputs.type] }}
BETA_ARG: ${{ github.event.inputs.beta == 'true' && '--preRelease=beta' || '' }}
run: npm run release -- --ci --verbose --no-git.push --no-git.commit --no-git.tag --no-github $TYPE_ARG $BETA_ARG $DRY_ARG
run: npm run release -- $TYPE_ARG --ci --verbose --no-git.push --no-git.commit --no-git.tag --no-github $BETA_ARG $DRY_ARG
- name: Show git status
if: failure()
run: git status && git diff
Expand Down
29 changes: 27 additions & 2 deletions .github/workflows/publish.yml
Expand Up @@ -11,6 +11,9 @@ 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'
Expand All @@ -22,7 +25,7 @@ jobs:
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- name: get-npm-version
Expand Down Expand Up @@ -50,6 +53,28 @@ jobs:
${{ steps.extract-release-notes.outputs.release_notes }}
############# NPM RELEASE ##############
- name: Publish the release to NPM
run: npm publish
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
notify:
needs: [publish]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
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: 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 }}
57 changes: 0 additions & 57 deletions .github/workflows/release.yml

This file was deleted.

0 comments on commit 399771e

Please sign in to comment.