Merge pull request #1448 from react-auth-kit/renovate/typescript-esli… #2039
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test and Release | |
on: | |
push: | |
branches: | |
- master | |
- next | |
- beta | |
pull_request: | |
branches: | |
- master | |
- next | |
- beta | |
jobs: | |
check-commit: | |
name: Check Commit Messages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Check Commit Messages | |
uses: wagoid/commitlint-github-action@v5 | |
test-node: | |
name: Test on Node.js v${{ matrix.node-version }} | |
runs-on: ubuntu-latest | |
needs: | |
- check-commit | |
strategy: | |
matrix: | |
node-version: [16.x, 18.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: NPM Install | |
run: npm ci | |
- name: NPM Test | |
run: npm test | |
- name: Generate Codecov Report | |
uses: codecov/codecov-action@v3 | |
test-os: | |
name: Test on ${{ matrix.os }} using Node.js LTS | |
needs: | |
- check-commit | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macOS-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setting Up Node 16.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- name: NPM Install | |
run: npm ci | |
- name: NPM Test | |
run: npm test | |
- name: Generate Codecov Report | |
uses: codecov/codecov-action@v3 | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: | |
- check-commit | |
- test-node | |
- test-os | |
outputs: | |
tag: ${{ steps.tag.outputs.tag }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 'lts/*' | |
- name: Install dependencies | |
run: npm ci | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npx semantic-release | |
- name: Get latest Tag | |
id: tag | |
run: | | |
echo "::set-output name=tag::$(git describe --tags --abbrev=0)" | |
release-docs: | |
name: Release Docs | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' }} | |
needs: | |
- release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Config the Action user | |
run: | | |
git fetch origin gh-pages --depth=1 | |
git config user.name github-actions | |
git config user.email [email protected] | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Install dependency | |
run: | | |
pip install mkdocs-material | |
pip install mike | |
- name: Deploying docs in Master | |
run: | | |
mkdocs gh-deploy --force | |
if: ${{ github.ref == 'refs/heads/master' }} | |
# - name: Deploying docs in Master | |
# run: | | |
# mike deploy --push --update-aliases ${{needs.release.outputs.tag}} latest | |
# mike set-default --push latest | |
# if: ${{ github.ref == 'refs/heads/master' }} | |
# - name: Deploying docs in Beta or Next | |
# run: mike deploy --push ${{needs.release.outputs.tag}} | |
# if: ${{ github.ref != 'refs/heads/master' }} |