71 lines
2.2 KiB
YAML
71 lines
2.2 KiB
YAML
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-22.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@v4
|
|
with:
|
|
name: CHANGELOG_${{ env.TAG }}.md
|
|
path: |
|
|
${{ github.workspace }}/CHANGELOG.md
|