Skip to content

Commit

Permalink
ci: setup release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseVSeb committed Jan 18, 2024
1 parent 7f9dd18 commit 7fbe823
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 13 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release

on:
workflow_dispatch:
push:
branches:
- main
- beta
- alpha

jobs:
release:
permissions:
contents: write
issues: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile --strict-peer-dependencies

- name: Semantic Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"author": "Jose V Sebastian",
"version": "0.0.0",
"license": "MIT",
"private": true,
"scripts": {
"start": "tsx ./src/cli",
"build": "rollup -c",
"prepack": "pnpm build",
"test": "jest --watch",
"lint": "eslint --quiet --fix",
"prepare": "husky install"
Expand All @@ -30,14 +30,13 @@
"node": ">=20"
},
"dependencies": {
"@optimize-lodash/rollup-plugin": "^4.0.4",
"cheerio": "1.0.0-rc.12",
"commander": "^11.1.0",
"glob": "^10.3.10",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21"
"lodash": "^4.17.21"
},
"devDependencies": {
"@optimize-lodash/rollup-plugin": "^4.0.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-eslint": "^9.0.5",
"@rollup/plugin-node-resolve": "^15.2.3",
Expand Down
36 changes: 27 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions release.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/** @type {import('semantic-release').GlobalConfig} */
const config = {
branches: [
"+([0-9])?(.{+([0-9]),x}).x",
"main",
"next",
"next-major",
{ name: "beta", prerelease: true },
{ name: "alpha", prerelease: true },
],
plugins: [
["@semantic-release/commit-analyzer", { preset: "conventionalcommits" }],
[
"@semantic-release/release-notes-generator",
{ preset: "conventionalcommits" },
],
[
"@semantic-release/changelog",
{
changelogTitle:
"# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines.",
},
],
["@semantic-release/npm", { tarballDir: "pack" }],
"@semantic-release/git",
["@semantic-release/github", { assets: "pack/*.tgz" }],
],
};

module.exports = config;

0 comments on commit 7fbe823

Please sign in to comment.