Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): prepare for version 1.0.0 alpha.25 #409

Merged
merged 21 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
abe291d
Merge tag 'v1.0.0-alpha.24' into develop
nekofar Nov 16, 2024
fa9c2f9
chore(deps-dev): bump typescript-eslint from 8.14.0 to 8.15.0 (#390)
dependabot[bot] Nov 19, 2024
ed51020
chore(deps-dev): bump @typescript-eslint/parser in the eslint group (…
dependabot[bot] Nov 19, 2024
a44ce42
chore(deps): bump hono from 4.6.10 to 4.6.11 (#392)
dependabot[bot] Nov 21, 2024
0eeb26e
chore(deps-dev): bump @types/node from 22.9.0 to 22.9.1 (#393)
dependabot[bot] Nov 21, 2024
9afe932
chore(deps-dev): bump eslint-plugin-unicorn from 56.0.0 to 56.0.1 (#391)
dependabot[bot] Nov 23, 2024
bc81b14
chore(deps): bump hono from 4.6.11 to 4.6.12 (#396)
dependabot[bot] Nov 27, 2024
d321360
chore(deps-dev): bump typescript-eslint from 8.15.0 to 8.16.0 (#398)
dependabot[bot] Nov 27, 2024
703bb8e
chore(deps-dev): bump typescript from 5.6.3 to 5.7.2 (#395)
dependabot[bot] Dec 1, 2024
b3ad0de
chore(deps-dev): bump eslint-plugin-jsdoc from 50.5.0 to 50.6.0 (#400)
dependabot[bot] Dec 1, 2024
f112eee
chore(deps-dev): bump prettier from 3.3.3 to 3.4.1 (#401)
dependabot[bot] Dec 1, 2024
3e17e1d
chore(deps-dev): bump @types/node from 22.9.1 to 22.10.1 (#402)
dependabot[bot] Dec 1, 2024
dbbe3bc
chore(deps-dev): bump the eslint group across 1 directory with 2 upda…
dependabot[bot] Dec 1, 2024
45e079a
chore(deps-dev): bump @typescript-eslint/parser in the eslint group (…
dependabot[bot] Dec 9, 2024
478bf2d
chore(deps-dev): bump globals from 15.12.0 to 15.13.0 (#405)
dependabot[bot] Dec 9, 2024
62cfa67
chore(deps-dev): bump typescript-eslint from 8.16.0 to 8.17.0 (#406)
dependabot[bot] Dec 9, 2024
ab51a5c
chore(deps-dev): bump prettier from 3.4.1 to 3.4.2 (#407)
dependabot[bot] Dec 9, 2024
d50d1ff
chore(deps): bump hono from 4.6.12 to 4.6.13 (#408)
dependabot[bot] Dec 9, 2024
811971e
chore(tsconfig): add `outDir` configuration
nekofar Dec 10, 2024
c81b733
chore(deps): add build and start scripts in `package.json`
nekofar Dec 10, 2024
857a9d4
ci(build): add GitHub Actions for build and release
nekofar Dec 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 158 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
name: Build Pipeline # A Build Pipeline which will use for build, test and deploy.

on:
push: # When we push the changes.
branches: # Only for these branches.
- master
- develop
- bugfix/*
- hotfix/*
- release/*
paths-ignore: # Ignoring the markdown file changes.
- '**/*.md'
pull_request: # Also on pull request events.
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab.

jobs:
check:
name: State Verifier
runs-on: ubuntu-latest
outputs:
skip_ci: ${{ steps.check_initial_commit.outputs.skip_ci }}
steps:
# The first step is to check out the repository code
- name: Checking out repository code
uses: actions/[email protected] # Action for checking out a repo.
with:
fetch-depth: 0 # Fetches all history for all branches and tags

# The second step checks whether the commit is the initial commit
- name: Check Initial Commit
id: check_initial_commit
run: |
# Use a git command to count the number of revisions
# If the count is 1, then this is the initial commit
if [ "$(git rev-list --count HEAD)" -eq 1 ]; then
echo "This is the initial commit."
# Set the environment variable "skip_ci" to true, signifying CI should not run for the initial commit
echo "skip_ci=true" >> $GITHUB_OUTPUT
else
# If the count is not 1, this is not the initial commit
# Set the environment variable "skip_ci" to false, signifying CI should run
echo "skip_ci=false" >> $GITHUB_OUTPUT
fi

build: # Job named 'build'
name: Build & Test
if: needs.check.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: [20.x, 21.x, 22.x] # Running tests across different environments.
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps: # The sequence of tasks that make up a job.
- name: Checking out repository code
uses: actions/[email protected] # Action for checking out a repo.

- name: Setup Node.js ${{ matrix.node-version }} Environment
uses: actions/[email protected] # Action for setting up Node environment.
with:
node-version: ${{ matrix.node-version }}

- name: Install pnpm package manager
uses: pnpm/[email protected] # Action for setting up pnpm.
id: pnpm-install
with:
run_install: false

- name: Capture pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Cache pnpm Store
uses: actions/[email protected] # Action provides caching dependencies and build outputs to improve workflow execution time.
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} # The path of the directory to cache.
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} # An explicit key for restoring and saving the cache.
restore-keys: |
${{ runner.os }}-pnpm-store-

# Installs all dependencies specified in the project's package.json file.
- name: Install dependencies using pnpm
run: pnpm install

# This compiles the application in optimized production mode and output it to the build folder.
- name: Build the application and export it
run: pnpm run build

# Runs unit tests for the application using Jest.
# - name: Execute tests using Jest
# run: pnpm run test

release:
name: Create Release
# Specify the type of the runner the job will run on
runs-on: ubuntu-latest

needs: [build]

if: ${{ github.ref_name == 'master' }}

# Set permissions to write contents
permissions:
contents: write

steps:
# Checkout the repository code
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 0 # Fetches all history for all branches and tags

# Generate a changelog for the new release using Git
- name: Generate a changelog
uses: orhun/[email protected]
id: git-cliff
with:
config: cliff.toml # The configuration file for git-cliff
args: -vv --latest --strip all # Show verbose output, grab the latest changes, and strip unnecessary details
env:
OUTPUT: CHANGES.md # The output file for the changelog

# Prepare release notes by processing the generated changelog
- name: Set the release info
id: release
shell: bash
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'
changelog="$(printf "$changelog" | tail -n +3)"
# Save the value of 'changelog' back into the GitHub environment output
{
echo "notes<<EOF"
echo "$changelog"
echo "EOF"
} >> $GITHUB_OUTPUT

# Create a new GitHub release using the gathered information
- name: Create the release
uses: nekofar/[email protected]
with:
tag: v${{ steps.release.outputs.version }} # The name of the tag to be released
title: v${{ steps.release.outputs.version }} # The title for the release
notes: ${{ steps.release.outputs.notes }} # The release notes generated in the previous step
draft: true # The release will be created as a draft
prerelease: ${{ contains(steps.release.outputs.version, '-rc') || contains(steps.release.outputs.version, '-beta') || contains(steps.release.outputs.version, '-alpha') }} # Conditions to mark the release as a pre-release

concurrency: # Allows controlling the concurrency level of the job in the build pipeline.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true # If enabled, previous runs of this workflow for the same group-key will be cancelled while this build or run is in progress.
24 changes: 13 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,34 @@
"dev": "pnpm run '/^dev:.*/'",
"dev:server": "tsx watch src/index.ts",
"dev:tunnel": "lt --port 3000",
"lint": "eslint"
"lint": "eslint",
"build": "tsc",
"start": "node dist/index.js"
},
"dependencies": {
"@hono/node-server": "1.13.7",
"hono": "4.6.10"
"hono": "4.6.13"
},
"devDependencies": {
"@types/eslint": "9.6.1",
"@types/eslint-config-prettier": "6.11.3",
"@types/node": "22.9.0",
"@typescript-eslint/parser": "8.14.0",
"eslint": "9.15.0",
"@types/node": "22.10.1",
"@typescript-eslint/parser": "8.17.0",
"eslint": "9.16.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-jsdoc": "50.5.0",
"eslint-plugin-jsdoc": "50.6.0",
"eslint-plugin-prettier": "5.2.1",
"eslint-plugin-regexp": "2.7.0",
"eslint-plugin-unicorn": "56.0.0",
"globals": "15.12.0",
"eslint-plugin-unicorn": "56.0.1",
"globals": "15.13.0",
"localtunnel": "2.0.2",
"prettier": "3.3.3",
"prettier": "3.4.2",
"prettier-plugin-jsdoc": "1.3.0",
"prettier-plugin-organize-attributes": "1.0.0",
"prettier-plugin-organize-imports": "4.1.0",
"tsx": "4.19.2",
"typescript": "5.6.3",
"typescript-eslint": "8.14.0"
"typescript": "5.7.2",
"typescript-eslint": "8.17.0"
},
"resolutions": {
"axios": ">=1.6.0",
Expand Down
Loading
Loading