Skip to content

Commit

Permalink
Merge branch 'release/1.0.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
nekofar committed Jul 30, 2023
2 parents 3f8704d + ddea5a0 commit 615ad5c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 20 deletions.
54 changes: 35 additions & 19 deletions .github/workflows/template.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,77 @@
# Workflow Name
# Assign a name to the workflow.
name: Template Cleanup

# Trigger the workflow on push events to the master branch
# Specify when this workflow is going to be triggered.
on:
# In this case, the workflow will be triggered whenever there is a push to the master branch.
push:
branches: [master]

# Define jobs
# Define the jobs that this workflow will perform.
jobs:
# Cleanup job
# Declare a job named 'cleanup'.
cleanup:
# Job runs on the latest Ubuntu version
# Specify the type of runner that the job should run on - Latest version of Ubuntu.
runs-on: ubuntu-latest

# Permissions
# Define permissions for this job.
permissions:
contents: write

# Conditional check
# A conditional check to ensure the job runs only if the name of the repository meets the constraint.
if: github.repository != 'nekofar/nextjs-lingui-template'

# Steps instances
# Define the steps to be followed in this job.
steps:
# Checkout the code.
- name: Checkout code
uses: actions/[email protected]

# Set up Node.js environment.
- name: Set up Node.js environment
uses: actions/[email protected]

- name: Install pnpm package manager # Install pnpm
# Install pnpm package manager.
- name: Install pnpm package manager
uses: pnpm/[email protected]
with:
version: ^8
run_install: false

# Clean up the repository.
- name: Clean up the repository
# The 'run:' statement let's you execute commands directly.
run: |
# Declare variables
# Declare and assign local variables.
NAME="$(basename $GITHUB_REPOSITORY)"
VERSION='1.0.0-alpha.0'
# Replace package.json name and version fields
pnpm json -I -f package.json -e "this.name='${NAME}'"
pnpm json -I -f package.json -e "this.version='${VERSION}'"
pnpm install --no-frozen-lockfile # Install dependencies (ignoring lock file)
# Use pnpm dlx json to modify package.json name and version fields.
pnpm dlx json -I -f package.json -e "this.name='${NAME}'"
pnpm dlx json -I -f package.json -e "this.version='${VERSION}'"
pnpm dlx install --no-frozen-lockfile # Install dependencies (ignoring lock file)
# Remove unnecessary files
# Remove template specific files and directories.
rm -rf \
.github/ISSUE_TEMPLATE \
.github/workflows/template.yml \
.github/dependabot.yml \
.github/FUNDING.yml \
.github/stale.yml \
CHANGELOG.md
CHANGELOG.md \
README.md
- name: Create Pull Request # Generate a pull request
uses: peter-evans/[email protected]
# Commit the changes made to the repository.
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m 'chore: initial template cleanup'
# Push the changes to the repository.
- name: Push changes
uses: ad-m/github-push-action@master
with:
commit-message: 'chore: initial template cleanup' # Commit message
branch: master
github_token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

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

## [1.0.11] - 2023-07-30

### <!-- 07 -->Continuous Integrations

- Update pnpm commands in `template` workflows
- Cdd README.md to `template` workflows
- Update and enhance `template` workflow

## [1.0.10] - 2023-07-30

### <!-- 07 -->Continuous Integrations
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nextjs-lingui-template",
"version": "1.0.10",
"version": "1.0.11",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down

0 comments on commit 615ad5c

Please sign in to comment.