ci: 👷 setup changeset and loredflow actions
This commit is contained in:
49
.github/actions/pnpm-setup/action.yml
vendored
Normal file
49
.github/actions/pnpm-setup/action.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
name: PNPM Setup
|
||||
|
||||
inputs:
|
||||
node-version:
|
||||
required: false
|
||||
type: number
|
||||
default: 18
|
||||
pnpm-version:
|
||||
required: false
|
||||
type: number
|
||||
default: 8
|
||||
install-deps:
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
|
||||
- name: Install PNPM
|
||||
uses: pnpm/action-setup@v2
|
||||
id: pnpm-install
|
||||
with:
|
||||
version: ${{ inputs.pnpm-version }}
|
||||
run_install: false
|
||||
|
||||
- name: Get store directory
|
||||
id: pnpm-cache
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Setup pnpm cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys:
|
||||
${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Install dependencies
|
||||
if: inputs.install-deps
|
||||
run: pnpm install
|
||||
shell: bash
|
||||
50
.github/workflows/release-branch.yml
vendored
Normal file
50
.github/workflows/release-branch.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
name: 🦋 Release branch
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- main
|
||||
|
||||
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
jobs:
|
||||
update-release:
|
||||
if: ${{ github.repository == 'loreddev/eslit' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
name: Update/Create release branch
|
||||
env:
|
||||
HUSKY: 0
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup environment
|
||||
uses: ./.github/actions/pnpm-setup
|
||||
|
||||
- name: Update release PR
|
||||
id: changesets
|
||||
uses: loreddev/changeset-action@main
|
||||
with:
|
||||
branch: main
|
||||
commit: 'ci: 👷🦋 version packages'
|
||||
title: 🦋 Release branch
|
||||
publish: pnpm run release
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Update dev branch
|
||||
if: steps.changesets.outputs.hasChangesets == 'false'
|
||||
uses: devmasx/merge-branch@master
|
||||
with:
|
||||
type: now
|
||||
from_branch: changeset-release/main
|
||||
target_branch: dev
|
||||
message: 'ci: 👷 update dev branch'
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
34
.github/workflows/release-preview.yml
vendored
Normal file
34
.github/workflows/release-preview.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: 👷 Release preview
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows:
|
||||
- 🧪 Code checking
|
||||
types:
|
||||
- completed
|
||||
branches:
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
release:
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository == 'loreddev/eslit' }}
|
||||
name: Release preview
|
||||
env:
|
||||
HUSKY: 0
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup environment
|
||||
uses: ./.github/actions/pnpm-setup
|
||||
|
||||
- name: Update versions
|
||||
run: pnpm changeset version --snapshot next
|
||||
|
||||
- name: Release packages
|
||||
run: pnpm run release --tag next
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"gitDir": "../../.git",
|
||||
"*": "ESLINT_USE_FLAT_CONFIG=true eslint . --fix"
|
||||
"*": "ESLINT_USE_FLAT_CONFIG=true eslint --fix"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@eslit-fixtures/svelte",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
"build": "vite build",
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
"lint": "turbo run lint",
|
||||
"lint:monorepo": "ESLINT_USE_FLAT_CONFIG=true eslint .",
|
||||
"test": "",
|
||||
"prepare": "husky install"
|
||||
"release": "changeset publish",
|
||||
"prepare": "husky install"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
|
||||
@@ -37,5 +37,8 @@
|
||||
"peerDependencies": {
|
||||
"eslint": "^8.45.0",
|
||||
"typescript": "^5.1.6"
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user