Repository navigation
62 lines (54 loc) 路 1.89 KB
/
Copy pathrelease.yml
File metadata and controls
62 lines (54 loc) 路 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: release
on:
workflow_dispatch:
push:
tags:
- 'v*.*.*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for git history
# Enable corepack, note that nodejs is already installed
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- id: meta
name: release meta
run: |
project=${GITHUB_REPOSITORY#*/}
echo "PROJECT=${project}" >> "$GITHUB_OUTPUT"
echo "PROJECT_CAP=${project^}" >> "$GITHUB_OUTPUT"
echo "TAG=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
- id: build_template
name: build release template
uses: ./.github/actions/build-template-action
with:
tag: ${{ steps.meta.outputs.TAG }}
project: ${{ steps.meta.outputs.PROJECT }}
- id: changelog
name: release changelog
run: |
pnpm dlx conventional-changelog-cli -p conventionalcommits -r 2 -o ${{ github.workspace }}/CHANGELOG_RELEASE.md
cat ${{ github.workspace }}/CHANGELOG_RELEASE.md
- id: create_release
name: create github draft release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.meta.outputs.TAG }}
name: ${{ steps.meta.outputs.PROJECT_CAP }} ${{ steps.meta.outputs.TAG }}
body_path: ${{ github.workspace }}/CHANGELOG_RELEASE.md
draft: true
prerelease: false
fail_on_unmatched_files: true
files: ${{ github.workspace }}/${{ steps.build_template.outputs.filepath }}
- name: publish github draft release
uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.APP_GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}