-
Notifications
You must be signed in to change notification settings - Fork 41
90 lines (78 loc) · 2.36 KB
/
deploy.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Deploy
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
if: ${{ !env.ACT }}
with:
fetch-depth: 0
- name: Get Next Version
id: semver
uses: ietf-tools/semver-action@v1
if: ${{ !env.ACT }}
with:
token: ${{ github.token }}
branch: main
- name: Create Draft Release
uses: ncipollo/release-action@v1.12.0
if: ${{ !env.ACT }}
with:
prerelease: true
draft: false
commit: ${{ github.sha }}
tag: ${{ steps.semver.outputs.next }}
name: ${{ steps.semver.outputs.next }}
body: '*pending*'
token: ${{ github.token }}
- name: Update CHANGELOG
if: ${{ !env.ACT }}
id: changelog
uses: ./
with:
token: ${{ github.token }}
tag: ${{ steps.semver.outputs.next }}
- name: Create Release
if: ${{ !env.ACT }}
uses: ncipollo/release-action@v1.12.0
with:
allowUpdates: true
draft: false
makeLatest: true
tag: ${{ steps.semver.outputs.next }}
name: ${{ steps.semver.outputs.next }}
body: ${{ steps.changelog.outputs.changes }}
token: ${{ github.token }}
- name: Create Release (Major-only)
if: ${{ !env.ACT }}
uses: ncipollo/release-action@v1.12.0
with:
allowUpdates: true
draft: false
commit: ${{ github.sha }}
tag: ${{ steps.semver.outputs.nextMajor }}
name: ${{ steps.semver.outputs.nextMajor }}
body: ${{ steps.changelog.outputs.changes }}
token: ${{ github.token }}
- name: Commit CHANGELOG.md
if: ${{ !env.ACT }}
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]'
file_pattern: CHANGELOG.md
# LOCAL TEST
- name: (local) Checkout Code
uses: actions/checkout@v2
if: ${{ env.ACT }}
with:
path: changelog-action
- name: (local) Update CHANGELOG
if: ${{ env.ACT }}
uses: ./
with:
token: ${{ github.token }}
tag: ${{ env.GITHUB_REF_NAME }}