From 7ec94df01396e2747abf25c7ff2242025549b17a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Kazami=20=5B=E4=B9=94=E6=B2=BB=C2=B7=E9=A2=A8?= =?UTF-8?q?=E8=A6=8B=5D?= Date: Sun, 5 Mar 2023 01:10:21 +0000 Subject: [PATCH] chore: add release CI --- .../release-and-update-changelog.yml | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/release-and-update-changelog.yml diff --git a/.github/workflows/release-and-update-changelog.yml b/.github/workflows/release-and-update-changelog.yml new file mode 100644 index 0000000..8ce393f --- /dev/null +++ b/.github/workflows/release-and-update-changelog.yml @@ -0,0 +1,59 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "main" branch +# push: +# branches: [ "main" ] +# pull_request: +# branches: [ "main" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + release-and-update-changelog: + # The type of runner that the job will run on + runs-on: [ self-hosted ] + name: Update the change log and generate a new tag for release + + strategy: + matrix: + node-version: [18.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + submodules: true + - uses: pnpm/action-setup@v2 + name: Install pnpm + id: pnpm-install + with: + version: 7 + run_install: false + + - name: Get pnpm store directory + id: pnpm-cache + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + - uses: actions/cache@v3 + name: Setup pnpm cache + 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 + run: pnpm install + + - name: update the changelog and add a new tag + run: pnpm release:changelog