Skip to content

Commit

Permalink
feat: Add workflow to template cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryohidaka committed May 6, 2024
1 parent 652301b commit edae165
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/template/.github/workflows/code-cov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Upload coverage reports to Codecov

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install dependencies
run: npm ci

- name: Generate coverage reports
run: npm run coverage

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: %AUTHOR%/%NAME%
24 changes: 24 additions & 0 deletions .github/template/.github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release Please

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
# Uncomment the following after cloning
- name: No operation
run: echo "No operation"
# - uses: google-github-actions/release-please-action@v3
# with:
# release-type: node
# package-name: %NAME%
# bump-minor-pre-major: true
# bump-patch-for-minor-pre-major: true
28 changes: 28 additions & 0 deletions .github/template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# %NAME%

[![npm version](https://badge.fury.io/js/%NAME%.svg)](https://badge.fury.io/js/%NAME%)
![build](https://github.com/%AUTHOR%/%NAME%/workflows/Build/badge.svg)
[![codecov](https://codecov.io/gh/%AUTHOR%/%NAME%/graph/badge.svg?token=RHP9TB2F51)](https://codecov.io/gh/%AUTHOR%/%NAME%)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)

## Overview

%DESCRIPTION%

## Notes

## Installation

You can install this library using npm:

```shell
npm install %NAME%
```

## Usage

## Link

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
13 changes: 13 additions & 0 deletions .github/template/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>%NAME%</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/example/main.ts"></script>
</body>
</html>
30 changes: 30 additions & 0 deletions .github/workflows/template-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# GitHub Actions Workflow responsible for cleaning up the WXT React Template repository from the template-specific files and configurations.
# This workflow is supposed to be triggered automatically when a new template-based repository has been created.

name: Template Cleanup

on:
push:
branches: [main]

jobs:
# Run a cleaning process only if the workflow is triggered by the non-"npm-package-template" repository.
template-cleanup:
name: Template Cleanup
runs-on: ubuntu-latest
if: github.event.repository.name != 'npm-package-template'
permissions:
contents: write
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4

# Cleanup project
- name: Cleanup
uses: ryohidaka/nodejs-cleanup@v1.1.3
with:
description: ""
excluded: "CHANGELOG, .github/FUNDING.yml, .github/workflows/template-cleanup.yml"
template-dir: ".github/template"
remove-template-dir: true

0 comments on commit edae165

Please sign in to comment.