-
Notifications
You must be signed in to change notification settings - Fork 790
65 lines (64 loc) · 2.23 KB
/
changelog.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
name: Changelog
on:
workflow_dispatch:
inputs:
repo:
description: "Repository"
default: "nanocurrency/nano-node"
required: true
ref:
description: "Version (VX.Y tag)"
default: "VX.Y"
required: true
ref_start:
description: "Start (VX.Y tag)"
default: ""
required: false
mode:
description: "Find tag as start"
type: choice
options:
- final
- beta
default: final
required: true
env:
artifact: 1
jobs:
changelog_job:
runs-on: ubuntu-20.04
timeout-minutes: 90
steps:
- name: Sets the tag and repo variables (to build)
run: |
echo "TAG=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
echo "REF_START=${{ github.event.inputs.ref_start }}" >> $GITHUB_ENV
echo "REPO_TO_RUN=${{ github.event.inputs.repo }}" >> $GITHUB_ENV
echo "MODE=${{ github.event.inputs.mode }}" >> $GITHUB_ENV
- name: Checks out the required workflow files (workflow repo)
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
repository: ${{ github.repository }}
- name: Install Dependencies
run: sudo apt-get install -yqq uuid
- name: Setup Python 3.x
uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 #v4.3.0
with:
python-version: '3.x'
- name: Installs PIP Packages
run: |
pip install PyGithub
pip install mdutils
- name: Generating the CHANGELOG file (automatic interval)
if: ${{ github.event.inputs.ref_start == '' }}
run: python util/changelog.py -v --repo $REPO_TO_RUN -m $MODE -t $TAG -p "${{ secrets.GITHUB_TOKEN }}"
- name: Generating the CHANGELOG file (selected interval)
if: ${{ github.event.inputs.ref_start != '' }}
run: python util/changelog.py -v --repo $REPO_TO_RUN --start-tag $REF_START -t $TAG -p "${{ secrets.GITHUB_TOKEN }}"
- name: Upload the Changelog Artifact
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb #v3.1.1
with:
name: CHANGELOG_${{ env.TAG }}.md
path: |
${{ github.workspace }}/CHANGELOG.md