Skip to content

Commit

Permalink
release workflow (#2374)
Browse files Browse the repository at this point in the history
* release workflow

* tweak

* mark uses and run as key

* tweak

* missing command

* merge commands

* yml ext

* separate install

* fix

* keep relative path

* add shell

* composite

* reorder jobs
  • Loading branch information
huozhi authored Jan 23, 2023
1 parent c57edae commit 1726bc6
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 16 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'Install'
description: 'Set up and install dependencies'

inputs:
fetch-depth:
default: '1'
required: false
persist-credentials:
default: true
required: false


runs:
using: composite
steps:
- name: Check out
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v2.2.2

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: pnpm

- name: Install Dependencies
shell: bash

run: |
corepack enable
pnpm install
env:
CI: true
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release

on:
push:
tags:
- v*

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3

- name: Install
uses: ./.github/workflows/install

- name: Publish
run: pnpm publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 10 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,17 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v2.2.2
with:
version: 7
- name: Install
uses: ./.github/workflows/install

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: pnpm

- run: pnpm install
- run: pnpm run-all-checks
- run: pnpm clean
- run: pnpm build
- run: pnpm test-packaging
- name: Lint
run: |
pnpm run-all-checks
pnpm clean
pnpm build
pnpm test-packaging
env:
CI: true

0 comments on commit 1726bc6

Please sign in to comment.