Skip to content

Commit

Permalink
ci: setup release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-sa committed Jan 18, 2024
1 parent f67cf73 commit f4a303c
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.json]
indent_size = 2

[*.ts]
[*.{tsx,ts,jsx,js}]
quote_type = single
indent_size = 4

[*.md]
max_line_length = off
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
on:
workflow_dispatch:
inputs:
version:
description: lerna version
required: true
type: choice
options:
- major
- minor
- patch
- premajor
- preminor
- prepatch
- prerelease

permissions:
contents: write
actions: read
pull-requests: read
id-token: write

jobs:
release:
runs-on: buildjet-2vcpu-ubuntu-2004
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 20.6.0

- name: Cache node_modules
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}

- name: npm install
run: npm ci

- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: lerna version
run: lerna version --no-private --verify-access ${{ inputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
LEFTHOOK: 0

- name: lerna publish
run: lerna publish from-git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
LEFTHOOK: 0

4 changes: 4 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"!packages/framework-examples"
],
"command": {
"version": {
"allowBranch": "master",
"conventionalCommits": true
},
"publish": {
"conventionalCommits": true
}
Expand Down

0 comments on commit f4a303c

Please sign in to comment.