Skip to content

Commit

Permalink
Merge pull request #61 from ccamacho/fetch-all
Browse files Browse the repository at this point in the history
Prune changelog, add job dependency, and release
  • Loading branch information
ccamacho authored Oct 21, 2020
2 parents a6a7177 + af91636 commit 55c01be
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 63 deletions.
57 changes: 0 additions & 57 deletions .github/workflows/docs_build.yml

This file was deleted.

66 changes: 64 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
---
# This job will execute a release:
# Ansible galaxy new release
# GitHub release with tag
# Documents release
name: release
on: [push]

on:
push:
branches:
- master

jobs:
build:

release_sw:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
Expand Down Expand Up @@ -32,3 +42,55 @@ jobs:
run: |
chmod +x ./tools/release.sh
sudo GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} ./tools/release.sh -k ${{ secrets.GALAXY_KEY }}
release_docs:
needs: release_sw
runs-on: ubuntu-latest
steps:
- name: Use checkout v2 with all git log available
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Render the changelog file
run: |
GITCHANGELOG_CONFIG_FILENAME=./tools/gitchangelog.rc ./tools/gitchangelog.py > ./docs/src/changelog.rst
cat ./docs/src/changelog.rst
- uses: kubeinit/sphinx-action@master
with:
pre-build-command: |
apt-get update -y && \
apt install build-essential -y && \
apt install gcc -y && \
touch /tmp/sphinx-log && \
pip3 install --upgrade pip && \
pip3 install --upgrade virtualenv && \
pip3 install --upgrade setuptools && \
pip3 install -r test-requirements.txt && \
pip3 install --upgrade ruamel.yaml && \
pip3 install --upgrade sphinx-rtd-theme && \
ansible-galaxy collection build kubeinit -v --force --output-path . && \
LATEST=$(ls kubeinit-kubeinit*.tar.gz | grep -v latest | sort -V | tail -n1) && \
ln -sf $LATEST kubeinit-kubeinit-latest.tar.gz && \
ansible-galaxy collection install --force kubeinit-kubeinit-latest.tar.gz
docs-folder: "docs/src/"
- uses: actions/upload-artifact@v1
with:
name: DocumentationHTML
path: docs/src/_build/html/
if-no-files-found: error
- name: Commit documentation changes
run: |
git clone https://github.com/kubeinit/kubeinit.git --branch gh-pages --single-branch gh-pages
cp -r docs/src/_build/html/* gh-pages/
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "KubeInit's bot"
git add .
git commit -m "Update documentation" -a || true
- name: Push changes
uses: ad-m/github-push-action@master
with:
force: true
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion kubeinit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<p style="text-align: center" align="center">
<a href="https://github.com/Kubeinit/kubeinit/actions?workflow=linters"><img height="20px" src="https://github.com/Kubeinit/kubeinit/workflows/linters/badge.svg?event=push"/> </a>
<a href="https://github.com/Kubeinit/kubeinit/actions?workflow=units"><img height="20px" src="https://github.com/Kubeinit/kubeinit/workflows/units/badge.svg?event=push"/> </a>
<a href="https://github.com/Kubeinit/kubeinit/actions?workflow=docs_build"><img height="20px" src="https://github.com/Kubeinit/kubeinit/workflows/docs_build/badge.svg?event=push"/> </a>
<a href="https://github.com/Kubeinit/kubeinit/actions?workflow=molecule"><img height="20px" src="https://github.com/Kubeinit/kubeinit/workflows/molecule/badge.svg?event=push"/> </a>
<a href="https://github.com/Kubeinit/kubeinit/actions?workflow=release"><img height="20px" src="https://github.com/Kubeinit/kubeinit/workflows/release/badge.svg?event=push"/> </a>
<a href="https://github.com/Kubeinit/kubeinit/actions?workflow=container_image"><img height="20px" src="https://github.com/Kubeinit/kubeinit/workflows/container_image/badge.svg?event=push"/> </a>
Expand Down
2 changes: 1 addition & 1 deletion kubeinit/galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
namespace: kubeinit
name: kubeinit
version: 0.5.6
version: 0.5.7
readme: README.md
authors:
- Carlos Camacho <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion tools/gitchangelog.rc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ ignore_regexps = [
r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[p|P]kg:',
r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*[d|D]ev:',
r'^(.{3,3}\s*:)?\s*[fF]irst commit.?\s*$',
r'^Merge pull request.*',
r'^$', ## ignore commits with empty messages
]

Expand All @@ -91,7 +92,6 @@ section_regexps = [
('Fix', [
r'^[fF]ix\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
]),

('Other', None ## Match all lines
),

Expand Down
5 changes: 4 additions & 1 deletion tools/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,15 @@ branch=$(git rev-parse --abbrev-ref HEAD)
generate_post_data()
{
timestamp=$(date +"%Y-%m-%d-%H-%M-%S")
release_count=$(curl https://api.github.com/repos/kubeinit/kubeinit/releases/ | jq '. | length')
next_id=$((release_count + 1))

cat <<EOF
{
"tag_name": "$current_galaxy_version",
"target_commitish": "$branch",
"name": "$current_galaxy_version.kubeinit-$timestamp",
"body": "Release changelog at: https://docs.kubeinit.com/changelog.html#$current_galaxy_version",
"body": "Release changelog at: https://docs.kubeinit.com/changelog.html#id$next_id",
"draft": false,
"prerelease": false
}
Expand Down

0 comments on commit 55c01be

Please sign in to comment.