Skip to content

Commit

Permalink
feat: enhance project for production readiness
Browse files Browse the repository at this point in the history
- Added README.md with project overview and setup instructions.
- Added development.md with guidelines and best practices for contributors.
- Introduced GitHub Actions workflows to automate testing and deployment processes.
  • Loading branch information
pplmx committed Aug 28, 2024
1 parent 3390f8f commit bde9e86
Show file tree
Hide file tree
Showing 28 changed files with 912 additions and 21 deletions.
44 changes: 44 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Bug report
about: Create a report to help us improve
title: 'bug: '
labels: bug
assignees: ''

---

## Bug description

<!-- A clear and concise description of what the bug is. -->

- Would you like to work on a fix? [y/n]

## To Reproduce

Steps to reproduce the behavior:

1. ...
2. ...
3. ...
4. ...

<!-- Make sure you are able to reproduce the bug in the main branch, too. -->

## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->

## Screenshots

<!-- If applicable, add screenshots to help explain your problem. -->

## Environment

<!-- Please fill the following information. -->

- OS: [e.g. Ubuntu 20.04]
- setup_me_action version: [e.g. 0.1.0]

## Additional context

<!-- Add any other context about the problem here. -->
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Feature request
about: Suggest an idea for this project
title: 'Feature Request: '
labels: enhancement
assignees: ''

---

## Motivations

<!--
If your feature request is related to a problem, please describe it.
-->

- Would you like to implement this feature? [y/n]

## Solution

<!-- Describe the solution you'd like. -->

## Alternatives

<!-- Describe any alternative solutions or features you've considered. -->

## Additional context

<!-- Add any other context or screenshots about the feature request here. -->
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- Please explain the changes you made -->

<!--
Please make sure:
- you have read the contributing guidelines:
https://github.com/pplmx/setup-me-action/blob/main/docs/CONTRIBUTING.md
- you have updated the changelog (if needed):
https://github.com/pplmx/setup-me-action/blob/main/CHANGELOG.md
-->
63 changes: 63 additions & 0 deletions .github/configs/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
version: 1

labels:
# Type: Build-related changes
- label: "@type/build"
title: '^build(?:\(.+\))?\!?:'

# Type: CI-related changes
- label: "@type/ci"
title: '^ci(?:\(.+\))?\!?:'
files:
- '\.github/.+'

# Type: Documentation changes
- label: "@type/docs"
title: '^docs(?:\(.+\))?\!?:'
files:
- "docs/.+"
- "**/*.md"

# Type: New feature
- label: "@type/feature"
title: '^feat(?:\(.+\))?\!?:'

# Type: Bug fix
- label: "@type/fix"
title: '^fix(?:\(.+\))?\!?:'

# Type: Improvements such as style changes, refactoring, or performance improvements
- label: "@type/improve"
title: '^(style|refactor|perf)(?:\(.+\))?\!?:'

# Type: Dependency changes
- label: "@type/dependency"
title: '^(chore|build)(?:\(deps\))?\!?:'

# Type: Test-related changes
- label: "@type/test"
title: '^test(?:\(.+\))?\!?:'
files:
- "tests/.+"
- "spec/.+"

# Type: Security-related changes
- label: "@type/security"
title: '^security(?:\(.+\))?\!?:'
files:
- "**/security/.+"

# Issue Type Only: Feature Request
- label: "Feature Request"
type: issue
title: "^Feature Request:"

# Issue Type Only: Documentation
- label: "Documentation"
type: issue
title: "^.*(\b[Dd]ocumentation|doc(s)?\b).*"

# Issue Type Only: Bug Report
- label: "Bug Report"
type: issue
title: "^.*(\b[Bb]ug|b(u)?g(s)?\b).*"
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
# Check for updates every Monday
schedule:
interval: "weekly"
open-pull-requests-limit: 10
4 changes: 4 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base"]
}
14 changes: 14 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: CD # Continuous Deployment or Delivery

on:
push:
# e.g. 1.0.0, v2.0.0, v0.1.0, v0.2.0-alpha, v0.3.0+build-71edf32
tags:
- '[v]?[0-9]+\.[0-9]+\.[0-9]+.*'

jobs:
dd:
name: Deploy or Delivery
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI # Continuous Integration

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
build-and-test:
name: Node.js-${{ matrix.node }}

strategy:
matrix:
node: [ 18, 20, 22 ]
os:
- ubuntu-latest
- windows-latest
- macos-latest

fail-fast: false

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Init dependencies
run: make init

- name: Build
run: make build

- name: Run tests
run: make test
54 changes: 54 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and Push Docker Image

on:
push:
tags:
- '^v[0-9]+\.[0-9]+\.[0-9]+.*$'

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Acquire tag name
run: echo "RELEASE_VERSION=${GITHUB_REF_NAME#refs/*/}" >> $GITHUB_ENV
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and Export to Docker
uses: docker/build-push-action@v6
with:
context: .
load: true
tags: |
ghcr.io/pplmx/setup-me-action:latest
ghcr.io/pplmx/setup-me-action:${GITHUB_REF_NAME:1}
-
name: Test it before Push
run: |
docker run --rm ghcr.io/pplmx/setup-me-action:latest
docker run --rm ghcr.io/pplmx/setup-me-action:${GITHUB_REF_NAME:1}
-
name: Build and Push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/pplmx/setup-me-action:latest
ghcr.io/pplmx/setup-me-action:${GITHUB_REF_NAME:1}
15 changes: 15 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Labeler

on:
- pull_request
- issues

jobs:
labeler:
runs-on: ubuntu-latest
steps:
- uses: srvaroa/labeler@master
with:
config_path: .github/configs/labeler.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm test
npx lint-staged
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- support some features

### Changed

- change some existed behaviors/logic

### Fixed

- fix some bugs
3 changes: 3 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Code of Conduct

This project adheres to the TypeScript Code of Conduct, which can be found [here](https://google.github.io/styleguide/tsguide.html).
50 changes: 50 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Contribution guidelines

First off, thank you for considering contributing to `setup-me-action`.

If your contribution is not straightforward, please first discuss the change you
wish to make by creating a new issue before making the change.

## Reporting issues

Before reporting an issue on the
[issue tracker](https://github.com/pplmx/setup-me-action/issues),
please check that it has not already been reported by searching for some related
keywords.

## Pull requests

Try to do one pull request per change.

### Updating the changelog

Update the changes you have made in
[CHANGELOG](CHANGELOG.md)
file under the **Unreleased** section.

Add the changes of your pull request to one of the following subsections,
depending on the types of changes defined by
[Keep a changelog](https://keepachangelog.com/en/1.0.0/):

- `Added` for new features.
- `Changed` for changes in existing functionality.
- `Deprecated` for soon-to-be removed features.
- `Removed` for now removed features.
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

If the required subsection does not exist yet under **Unreleased**, create it!

## Developing

### Set up

This is no different from other Python projects.

```shell
git clone https://github.com/pplmx/setup-me-action
cd setup-me-action
make test
```

### Useful Commands
Loading

0 comments on commit bde9e86

Please sign in to comment.