Skip to content

Commit

Permalink
workflow(cd): add release action (#10)
Browse files Browse the repository at this point in the history
* chore: add release script

* chore: fix pkg version

* workflow(cd): add release action
  • Loading branch information
zhoushaw authored Jul 25, 2024
1 parent 1cb6416 commit 3cb5b42
Show file tree
Hide file tree
Showing 6 changed files with 364 additions and 12 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release Version(minor,patch,preminor,prepatch)'
required: true
default: 'patch'
branch:
description: 'Release Branch(confirm release branch)'
required: true
default: 'main'

jobs:
release:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [16.14.0]
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }}
- name: Pushing to the protected branch 'protected'
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }}
branch: ${{ github.event.inputs.branch }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Cache .pnpm-store
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9.3.0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: release
run: node ./scripts/release.js --version=${{ github.event.inputs.version }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: changelog
run: npx conventional-github-releaser -p angular
env:
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{secrets.GITHUB_TOKEN}}
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "infra",
"name": "midscene",
"private": true,
"version": "1.0.0",
"version": "0.0.1",
"description": "",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -31,7 +31,13 @@
"pretty-quick": "3.1.3",
"@changesets/cli": "2.24.1",
"commitizen": "4.2.5",
"nx": "19.5.2"
"nx": "19.5.2",
"semver": "7.3.7",
"dayjs": "1.11.2",
"minimist": "1.2.5",
"execa": "4.1.0",
"chalk": "4.1.2",
"@jsdevtools/version-bump-prompt": "6.1.0"
},
"config": {
"commitizen": {
Expand Down
2 changes: 1 addition & 1 deletion packages/midscene/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@midscene/core",
"description": "Hello, It's MidScene",
"version": "0.1.1",
"version": "0.0.1",
"jsnext:source": "./src/index.ts",
"main": "./dist/lib/index.js",
"module": "./dist/es/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/web-integration/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@midscene/web",
"description": "Web integration for MidScene.js",
"version": "0.1.1",
"version": "0.0.1",
"jsnext:source": "./src/index.ts",
"main": "./dist/lib/index.js",
"module": "./dist/es/index.js",
Expand Down
Loading

0 comments on commit 3cb5b42

Please sign in to comment.