forked from mikepenz/release-changelog-builder-action
-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (107 loc) · 3.74 KB
/
ci.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: 'CI'
on:
push:
tags:
- '*'
pull_request:
jobs:
build:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Install NPM
run: |
npm install
- name: Run NPM
run: |
npm run all
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
# the below actions use the local state of the action. please replace `./` with `mikepenz/release-changelog-builder-action@{latest-release}`
# Showcases how to use the action without a prior checkout
# Won't support providing a configuration file, as no checkout was done
- name: "Configuration without Checkout"
id: without_checkout
uses: mikepenz/release-changelog-builder-action@develop
with:
toTag: "v0.0.3"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Echo Configuration without Checkout Changelog
env:
CHANGELOG: ${{ steps.without_checkout.outputs.changelog }}
run: echo "CHANGELOG"
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
# Showcase the most minimal configuration possible
- name: "Minimal Configuration"
id: minimal_release
uses: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Echo Minimal Configuration Changelog
env:
CHANGELOG: ${{ steps.minimal_release.outputs.changelog }}
run: echo "$CHANGELOG"
# Showcases a more complex configuration, providing a configuration, and specifically referencing owner, repo, from and to tag
- name: "Complex Configuration"
id: complex_release
uses: ./
with:
configuration: "configs/configuration_complex.json"
owner: "mikepenz"
repo: "release-changelog-builder-action"
fromTag: "v0.0.1"
toTag: "v0.0.3"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Echo Complex Configuration Changelog
env:
CHANGELOG: ${{ steps.complex_release.outputs.changelog }}
run: echo "CHANGELOG"
# Showcases the capability to generate the changelog for an external repository provided
- name: "External Repo Configuration"
id: external_changelog
uses: ./
with:
configuration: "configs/configuration_complex.json"
owner: "mikepenz"
repo: "MaterialDrawer"
fromTag: "v8.1.0"
toTag: "v8.1.6"
token: ${{ secrets.PERSONAL_TOKEN }}
- name: Echo External Repo Configuration Changelog
env:
CHANGELOG: ${{ steps.external_changelog.outputs.changelog }}
run: echo "$CHANGELOG"
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: "Build Changelog"
id: github_release
uses: mikepenz/release-changelog-builder-action@v2
with:
configuration: "configs/configuration_repo.json"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: softprops/action-gh-release@6034af24fba4e5a8e975aaa6056554efe4c794d0
with:
body: ${{steps.github_release.outputs.changelog}}
prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-b') || contains(github.ref, '-a') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}