forked from saltstack/salt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automate build of changelog and man pages
- Loading branch information
Megan Wilhite
committed
Oct 11, 2021
1 parent
4998b6c
commit acd3fde
Showing
7 changed files
with
298 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Re-Tag Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
saltVersion: | ||
description: 'Salt Version' | ||
required: true | ||
|
||
jobs: | ||
ReGenerateTagRelease: | ||
name: Re-Generate Tag and Github Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: dev-drprasad/[email protected] | ||
with: | ||
delete_release: true # default: false | ||
tag_name: v${{ github.event.inputs.saltVersion }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: actions/checkout@v2 | ||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
custom_tag: ${{ github.event.inputs.saltVersion }} | ||
dry_run: True | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install pypa/build | ||
run: | | ||
python -m pip install build --user | ||
- name: Build a binary wheel and a source tarball | ||
run: | | ||
python -m build --sdist --outdir dist/ . | ||
- name: Create a GitHub release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ steps.tag_version.outputs.new_tag }} | ||
name: Release ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.new_tag }} | ||
artifacts: dist/salt*.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Generate Tag and Github Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
saltVersion: | ||
description: 'Salt Version' | ||
required: true | ||
|
||
jobs: | ||
GenerateTagRelease: | ||
name: Generate Tag and Github Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
custom_tag: ${{ github.event.inputs.saltVersion }} | ||
dry_run: True | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install pypa/build | ||
run: | | ||
python -m pip install build --user | ||
- name: Build a binary wheel and a source tarball | ||
run: | | ||
python -m build --sdist --outdir dist/ . | ||
- name: Create a GitHub release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ steps.tag_version.outputs.new_tag }} | ||
name: Release ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.new_tag }} | ||
artifacts: dist/salt*.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
name: Generate Release Docs | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
saltVersion: | ||
description: 'Salt Version' | ||
required: true | ||
manPages: | ||
description: "Build Man Pages" | ||
default: true | ||
required: false | ||
|
||
jobs: | ||
SaltChangelog: | ||
name: Build Salt Changelog | ||
runs-on: ubuntu-latest | ||
|
||
container: | ||
image: python:3.8.6-slim-buster | ||
|
||
steps: | ||
|
||
- name: Install System Deps | ||
run: | | ||
echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list | ||
apt-get update | ||
apt-get install -y enchant git gcc imagemagick make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev xz-utils | ||
apt-get install -y git/buster-backports | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Nox | ||
env: | ||
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/ | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install nox | ||
- id: changed-files | ||
name: Get Changed Files | ||
uses: dorny/paths-filter@v2 | ||
with: | ||
token: ${{ github.token }} | ||
list-files: json | ||
filters: | | ||
docs: | ||
- doc/** | ||
- name: Install Python Requirements | ||
env: | ||
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/ | ||
run: | | ||
nox --install-only --forcecolor -e 'changelog(force=True, draft=False)' -- ${{ github.event.inputs.saltVersion }} | ||
nox --install-only --forcecolor -e 'changelog(force=False, draft=True)' -- ${{ github.event.inputs.saltVersion }} | ||
- name: Build Changelog | ||
env: | ||
SKIP_REQUIREMENTS_INSTALL: YES | ||
run: | | ||
nox --forcecolor -e 'changelog(force=False, draft=True)' -- ${{ github.event.inputs.saltVersion }} > rn_changelog | ||
nox --forcecolor -e 'changelog(force=True, draft=False)' -- ${{ github.event.inputs.saltVersion }} | ||
- name: Store Generated Changelog | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: salt-changelog | ||
path: | | ||
CHANGELOG.md | ||
changelog/* | ||
rn_changelog | ||
Manpages: | ||
name: Build Salt man Pages | ||
runs-on: ubuntu-latest | ||
|
||
container: | ||
image: python:3.8.6-slim-buster | ||
|
||
steps: | ||
|
||
- name: Install System Deps | ||
if: github.event.inputs.manPages == 'true' | ||
run: | | ||
echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list | ||
apt-get update | ||
apt-get install -y enchant git gcc imagemagick make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev | ||
apt-get install -y git/buster-backports | ||
- uses: actions/checkout@v2 | ||
|
||
- id: changed-files | ||
if: github.event.inputs.manPages == 'true' | ||
name: Get Changed Files | ||
uses: dorny/paths-filter@v2 | ||
with: | ||
token: ${{ github.token }} | ||
list-files: json | ||
filters: | | ||
docs: | ||
- doc/** | ||
- name: Install Nox | ||
if: github.event.inputs.manPages == 'true' | ||
env: | ||
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/ | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install nox | ||
- name: Install Python Requirements | ||
if: github.event.inputs.manPages == 'true' | ||
env: | ||
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/ | ||
run: | ||
nox --install-only --forcecolor -e 'docs-man(compress=False, update=True, clean=True)' | ||
|
||
- name: Build Manpages | ||
if: github.event.inputs.manPages == 'true' | ||
env: | ||
SKIP_REQUIREMENTS_INSTALL: YES | ||
run: | | ||
nox --forcecolor -e 'docs-man(compress=False, update=True, clean=True)' | ||
- name: Store Generated Documentation | ||
if: github.event.inputs.manPages == 'true' | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: salt-man-pages | ||
path: doc/_build/man | ||
|
||
PullRequest: | ||
needs: [SaltChangelog, Manpages] | ||
name: Create Pull Request | ||
runs-on: ubuntu-latest | ||
|
||
container: | ||
image: python:3.8.6-slim-buster | ||
|
||
steps: | ||
- name: Install System Deps | ||
run: | | ||
echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list | ||
apt-get update | ||
apt-get install -y enchant git gcc imagemagick make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev xz-utils | ||
apt-get install -y git/buster-backports | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Download salt-man-pages | ||
if: github.event.inputs.manPages == 'true' | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: salt-man-pages | ||
path: doc/man/ | ||
|
||
- name: Download salt changelog | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: salt-changelog | ||
|
||
- name: Generate Release Notes | ||
run: | | ||
sed -i '0,/^======/d' rn_changelog | ||
cat rn_changelog | ||
cat rn_changelog >> doc/topics/releases/${{ github.event.inputs.saltVersion }}.rst | ||
rm rn_changelog | ||
- name: Create Pull Request for Release | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: Add changelog and docs for release | ||
title: 'Generate Salt Man Page and Changelog' | ||
body: > | ||
This PR is auto-generated by | ||
[create-pull-request](https://github.com/peter-evans/create-pull-request). | ||
branch: freeze |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3004 |