mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-05-02 00:07:23 +08:00
ci: modernize GitHub workflows and templates
Update CI workflow: restrict triggers to master+PRs, add concurrency groups and npm cache. Update release-please and stale workflows to latest action versions. Replace single ISSUE_TEMPLATE.md with YAML- based templates (bug report, feature request, config). Rewrite CONTRIBUTING.md for awesome-cordova-plugins.
This commit is contained in:
@@ -1,21 +1,27 @@
|
||||
name: Node CI
|
||||
name: CI
|
||||
|
||||
on: [push]
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
concurrency:
|
||||
group: ci-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
- uses: actions/checkout@v4.3.1
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4.4.0
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
node-version: 22
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
@@ -23,11 +29,8 @@ jobs:
|
||||
- name: Lint
|
||||
run: npm run lint -- --quiet
|
||||
|
||||
- name: Test
|
||||
run: npm test
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
- name: Test
|
||||
run: npm run test
|
||||
|
||||
- name: Readmes
|
||||
run: npm run readmes
|
||||
|
||||
@@ -2,9 +2,7 @@ name: Release Please
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
# Manual trigger as backup
|
||||
branches: [master]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
@@ -19,58 +17,42 @@ jobs:
|
||||
release_created: ${{ steps.release.outputs.release_created }}
|
||||
tag_name: ${{ steps.release.outputs.tag_name }}
|
||||
version: ${{ steps.release.outputs.version }}
|
||||
pr: ${{ steps.release.outputs.pr }}
|
||||
steps:
|
||||
- name: Run Release Please
|
||||
id: release
|
||||
uses: googleapis/release-please-action@v4
|
||||
uses: googleapis/release-please-action@v4.4.0
|
||||
with:
|
||||
# GitHub token for creating PRs and releases
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Use manifest-based configuration (advanced setup)
|
||||
config-file: release-please-config.json
|
||||
manifest-file: .release-please-manifest.json
|
||||
|
||||
- name: Show Release Info
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
run: |
|
||||
echo "Release created: ${{ steps.release.outputs.release_created }}"
|
||||
echo "Tag: ${{ steps.release.outputs.tag_name }}"
|
||||
echo "Version: ${{ steps.release.outputs.version }}"
|
||||
echo "PR: ${{ steps.release.outputs.pr }}"
|
||||
|
||||
# Trigger the existing build and publish workflow when a release is created
|
||||
build-and-publish:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
needs: release-please
|
||||
if: ${{ needs.release-please.outputs.release_created }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v4.3.1
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v4.4.0
|
||||
with:
|
||||
node-version: "20"
|
||||
cache: "npm"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
node-version: 22
|
||||
cache: npm
|
||||
registry-url: https://registry.npmjs.org
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run linting
|
||||
run: npm run lint
|
||||
- name: Lint
|
||||
run: npm run lint -- --quiet
|
||||
|
||||
- name: Run tests
|
||||
- name: Test
|
||||
run: npm test
|
||||
|
||||
- name: Build packages
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
- name: Generate README files
|
||||
run: npm run readmes
|
||||
|
||||
- name: Publish all packages to NPM
|
||||
- name: Publish to npm
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: npm run npmpub
|
||||
|
||||
+22
-14
@@ -1,22 +1,30 @@
|
||||
name: Mark stale issues and pull requests
|
||||
name: Stale issues and PRs
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
- cron: "0 6 * * 1"
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'There has been no recent activity and this issue has been marked inactive.'
|
||||
stale-pr-message: 'There has been no recent activity and this PR has been marked inactive.'
|
||||
stale-issue-label: 'status: inactive'
|
||||
stale-pr-label: 'status: inactive'
|
||||
- uses: actions/stale@v9.1.0
|
||||
with:
|
||||
stale-issue-message: >
|
||||
This issue has been automatically marked as inactive due to lack of
|
||||
recent activity. It will be closed in 14 days if no further activity
|
||||
occurs.
|
||||
stale-pr-message: >
|
||||
This PR has been automatically marked as inactive due to lack of
|
||||
recent activity. It will be closed in 14 days if no further activity
|
||||
occurs.
|
||||
stale-issue-label: "status: inactive"
|
||||
stale-pr-label: "status: inactive"
|
||||
days-before-stale: 60
|
||||
days-before-close: 14
|
||||
exempt-issue-labels: "pinned,keep"
|
||||
exempt-pr-labels: "pinned,keep"
|
||||
|
||||
Reference in New Issue
Block a user