ci: 👷 loredflow workflows

This commit is contained in:
Guz013
2023-07-07 14:59:25 -03:00
parent e951837f36
commit 2c4f38f916
5 changed files with 103 additions and 13 deletions

View File

@@ -4,8 +4,8 @@
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"access": "public",
"baseBranch": "dev",
"updateInternalDependencies": "patch",
"ignore": [],
"privatePackages": {

64
.github/workflows/release-branch.yml vendored Normal file
View File

@@ -0,0 +1,64 @@
name: 🦋 Release branch
on:
push:
branches:
- dev
pull_request:
branches:
- main
types:
- closed
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
update-release:
if: github.ref_name == 'dev'
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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
update-dev:
if: github.ref_name == 'main' && github.event.pull_request.merged == true && github.event.pull_request.title == '🦋 Release branch'
runs-on: ubuntu-latest
name: Update dev branch
timeout-minutes: 2
env:
HUSKY: 0
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Release to dev
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 }}

33
.github/workflows/release-preview.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
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/marknow' }}
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 }}

View File

@@ -8,8 +8,6 @@ on:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository == 'loreddev/marknow' }}
@@ -28,13 +26,8 @@ jobs:
- name: Setup environment
uses: ./.github/actions/pnpm-setup
- name: Create Release PR or Public to NPM
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
commit: 'chore: 🔗🦋 version packages'
title: '🦋 Changeset: Version packages'
- name: Release packages
run: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@@ -17,7 +17,7 @@
"build:pkg": "turbo run build --filter='./packages/*'",
"dev": "turbo run dev --filter=\"@marknow/www\"",
"preview": "turbo run preview --filter=\"@marknow/www\"",
"release": "pnpm run build:pkg && changeset publish --access public"
"release": "pnpm run build:pkg && changeset publish"
},
"devDependencies": {
"@antfu/eslint-config": "^0.39.5",