-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 1.88 KB
/
release.yml
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
63
64
65
66
67
name: "🔖 Draft Release"
on:
workflow_call:
secrets:
REPO_TOKEN:
required: true
workflow_dispatch:
secrets:
REPO_TOKEN:
required: true
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: 'bash'
jobs:
release:
name: "🔖 Draft Release"
runs-on: ubuntu-latest
outputs:
release-note: ${{ steps.changelog.outputs.changelog }}
version: ${{ steps.version.outputs.current-version }}
steps:
- name: 📁 Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: ⬅️ Get previous git tag
id: tag
run: echo "last-tag=$(git describe --tags --abbrev=0 || git rev-list --max-parents=0 ${{github.ref}})" >> $GITHUB_OUTPUT
- name: 🏷️ Get Release Version
id: version
uses: martinbeentjes/npm-get-version-action@main
- name: 📑 Generate Changelog
uses: nick-fields/private-action-loader@v3
id: changelog
with:
pal-repo-token: ${{ secrets.REPO_TOKEN }}
pal-repo-name: lucaslabstech/[email protected]
token: ${{ secrets.GITHUB_TOKEN }}
from: ${{ steps.tag.outputs.last-tag }}
to: ${{ github.ref }}
next-version: v${{ steps.version.outputs.current-version }}
- name: 🗑️ Delete outdated drafts
uses: hugo19941994/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 🔖 Create Release
uses: ncipollo/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
prerelease: false
draft: true
tag: v${{ steps.version.outputs.current-version }}
name: v${{ steps.version.outputs.current-version }}
body: ${{ steps.changelog.outputs.changelog }}