Skip to content

Commit

Permalink
Merge branch 'release/1.0.18'
Browse files Browse the repository at this point in the history
  • Loading branch information
nekofar committed Aug 11, 2023
2 parents 2964e3b + d6cd223 commit 4eda67c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,26 @@ on:
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab.

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Check Initial Commit
id: check_initial_commit
run: |
if [ "$(git rev-list --count HEAD)" -eq 1 ]; then
echo "This is the initial commit."
echo "skip_ci=true" >> $GITHUB_ENV
else
echo "skip_ci=false" >> $GITHUB_ENV
fi
build: # Job named 'build'
name: Build & Test
if: needs.check_initial_commit.outputs.skip_ci != 'true'
runs-on: ubuntu-latest # The type of machine to run the job on.

needs: [check]

strategy: # Allows you to create a matrix for job configuration.
matrix:
node-version: [18.x, 19.x, 20.x] # Running tests across different environments.
Expand Down Expand Up @@ -100,7 +116,7 @@ jobs:
run: |
version=$(jq -r '.version' package.json)
echo "version=${version}" >> $GITHUB_OUTPUT
# Read contents of changelog into variable 'changelog_content'
changelog=$(cat ${{ steps.git-cliff.outputs.changelog }})
# Remove first two lines from 'changelog'
Expand Down
3 changes: 2 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm run lint:staged
pnpm lingui extract $(git diff --name-only --staged)
pnpm lint-staged
pnpm test
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

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

## [1.0.18] - 2023-08-11

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

- Add initial commit check to build workflow

### <!-- 08 -->Miscellaneous Tasks

- Add linting for json and yaml files
- Update pre-commit hook and cleanup package.json scripts

## [1.0.17] - 2023-08-11

### <!-- 07 -->Continuous Integrations
Expand Down
1 change: 1 addition & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ const buildEslintCommand = (filenames) =>
module.exports = {
'*.{js,jsx,ts,tsx}': [buildEslintCommand, 'prettier --write'],
'*.{md,mdx}': ['prettier --write'],
'*.{json,yaml,yml}': ['prettier --write'],
}
7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
{
"name": "nextjs-lingui-template",
"version": "1.0.17",
"version": "1.0.18",
"private": true,
"scripts": {
"dev": "next dev",
"prebuild": "pnpm run lingui:extract",
"build": "next build",
"prestart": "pnpm run build",
"start": "serve out",
"lint": "next lint",
"lint:staged": "lint-staged",
"lingui:extract": "lingui extract --clean",
"lingui:compile": "lingui compile",
"format": "prettier --log-level error --write .",
"test": "jest",
"preinstall": "pnpx typesync || :",
"prepare": "husky install"
Expand Down

0 comments on commit 4eda67c

Please sign in to comment.