Add release workflow to github action (#2363)

* ci: add release to github action
This commit is contained in:
Hu Song
2024-08-27 17:43:18 +08:00
committed by GitHub
parent 337ba2e802
commit cb058362b3
14 changed files with 4509 additions and 3314 deletions

View File

@@ -19,7 +19,7 @@ jobs:
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 22.x
cache: pnpm
- name: Install
@@ -33,7 +33,7 @@ jobs:
strategy:
matrix:
node-version: [16.x]
node-version: [22.x]
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
@@ -60,7 +60,7 @@ jobs:
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 22.x
cache: pnpm
- name: Install
@@ -79,7 +79,7 @@ jobs:
strategy:
matrix:
node-version: [16.x]
node-version: [22.x]
steps:
- uses: actions/checkout@v3

34
.github/workflows/release-note.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
# This is a basic workflow to help you get started with Actions
name: Release Note
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
release:
types: [published]
# 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"
message:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Dump Github context
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Send notification to Dingding
if: success()
uses: mrkou47/action-dingding-webhook@main
env:
DINGDING_SECRET_TOKEN_MAP: ${{ secrets.DINGDING_SECRET_TOKEN_MAP }}
with:
title: Release Note ${{ github.event.release.tag_name }}
text: ${{ toJSON(github.event.release.body) }}

View File

@@ -1,34 +1,42 @@
# This is a basic workflow to help you get started with Actions
name: Release Note
name: Release
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
release:
types: [published]
# Allows you to run this workflow manually from the Actions tab
push:
tags:
- 'v*'
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"
message:
# The type of runner that the job will run on
release:
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
permissions:
contents: write
id-token: write
steps:
- name: Dump Github context
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Send notification to Dingding
if: success()
uses: mrkou47/action-dingding-webhook@main
env:
DINGDING_SECRET_TOKEN_MAP: ${{ secrets.DINGDING_SECRET_TOKEN_MAP }}
- uses: actions/checkout@v3
with:
title: Release Note ${{ github.event.release.tag_name }}
text: ${{ toJSON(github.event.release.body) }}
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
run_install: true
# after pnpm
- name: Use Node.js LTS
uses: actions/setup-node@v3
with:
node-version: lts/*
registry-url: https://registry.npmjs.org/
cache: pnpm
- name: Build
run: pnpm b:all
- name: Release current monorepo
uses: gz65555/publish@v0.0.6
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true