Skip to content

Commit 40421d4

Browse files
committed
Merge branch 'issues/58_release_2015-10-03' into issues/58_release_2016-08-14
2 parents d681a18 + 325f92e commit 40421d4

File tree

3 files changed

+318
-0
lines changed

3 files changed

+318
-0
lines changed
Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
# ------------------------------------------------------------------------------------------
2+
# This is a workflow to release this project as a zipped installable artifact.
3+
# Release version numbering and release notes generation is following standards defined by:
4+
#
5+
# https://semver.org
6+
# https://keepachangelog.com
7+
# https://common-changelog.org
8+
#
9+
# Note: Since DokuWiki is using version numbering in format YYYY-MM-DD we use this numbering
10+
# format rather than a dotted numbering scheme.
11+
# The git tag names have to use a 'v' as prefix to the DokuWiki version number.
12+
#
13+
# ------------------------------------------------------------------------------------------
14+
name: Build a release
15+
16+
on:
17+
# Triggers the workflow on push of a tag filtering the tag to meet
18+
# semantic version numbering according to https://semver.org
19+
# Here we use the DokuWiki conform version number pattern.
20+
push:
21+
tags:
22+
['v[0-9]+-[0-9]+-[0-9]+']
23+
24+
# Allows you to run this workflow manually from the Actions tab
25+
workflow_dispatch:
26+
27+
jobs:
28+
# Ensure that we run on tag references only
29+
validate_github_reference:
30+
name: Validate the tag reference
31+
# The type of runner that the job will run on
32+
runs-on: ubuntu-latest
33+
# Validate tag
34+
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
35+
steps:
36+
- run: |
37+
echo "The selected git ref=${{ github.ref }} is NOT a valid release tag. Please select a valid release TAG as reference."
38+
exit 1
39+
40+
# Create a release
41+
release:
42+
name: Release
43+
# The type of runner that the job will run on
44+
runs-on: ubuntu-latest
45+
# Set job wide environment
46+
env:
47+
APP_NAME: dokuwiki-plugin-gitbacked
48+
APP_INFO_FILE: plugin.info.txt
49+
APP_INFO_FILE_VERSION_KEY: date
50+
BUILD_DIR: build
51+
ZIP_EXCLUSIONS: '*.git* .editorconfig /*.github/* /*build/* RELEASE_HEAD.md'
52+
53+
steps:
54+
# Log use case if triggered manually
55+
- name: Log use case if triggered manually
56+
if: ${{ github.event_name == 'workflow_dispatch' }}
57+
run: |
58+
echo "Workflow has been triggered manually"
59+
60+
# Log use case if triggered by push
61+
- name: Log use case if triggered by push
62+
if: ${{ github.event_name == 'push' }}
63+
run: |
64+
echo "Workflow has been triggered by push to ${{ github.ref }}"
65+
66+
# Check out this repo
67+
- name: Checkout
68+
uses: GHCICD/checkout@v3
69+
70+
# Set version tags as global environment properties
71+
- name: Prepare Version Tags
72+
run: |
73+
#echo "MAJOR_VERSION=$(echo ${GITHUB_REF/refs\/tags\//} | awk -F'-' '{print $1}')" >> $GITHUB_ENV
74+
#echo "MINOR_VERSION=$(echo ${GITHUB_REF/refs\/tags\//} | awk -F'-' '{print $1"-"$2}')" >> $GITHUB_ENV
75+
#echo "FULL_VERSION=$(echo ${GITHUB_REF/refs\/tags\//} | awk -F'-' '{print $1"-"$2"-"$3}')" >> $GITHUB_ENV
76+
echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
77+
echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
78+
echo "APP_INFO_VERSION=$(sed -n -E 's/^${{ env.APP_INFO_FILE_VERSION_KEY }}[ \t]+([0-9-]+).*/\1/p' ${{ env.APP_INFO_FILE }})" >> $GITHUB_ENV
79+
80+
# Validate app info version and set release name
81+
- name: Validate app info version and set release name
82+
run: |
83+
if [ "${{ env.RELEASE_VERSION }}" != "${{ env.APP_INFO_VERSION }}" ]; then
84+
echo "Mismatch of release version=${{ env.RELEASE_VERSION }} and application info version=${{ env.APP_INFO_VERSION }}!" >&2
85+
echo "Please review the value for key=${{ env.APP_INFO_FILE_VERSION_KEY }} in file ${{ env.APP_INFO_FILE }}."
86+
exit 1
87+
fi
88+
echo "RELEASE_NAME=Release ${{ env.APP_INFO_VERSION }}" >> $GITHUB_ENV
89+
90+
- name: Validate CHANGELOG.md for this release version
91+
# explanation of sed command:
92+
# 1. select lines between SED_VERSION_BEGIN_PATTERN and SED_VERSION_END_PATTERN
93+
# 2. invert this selection
94+
# 3. delete it
95+
# => only selection is remaining in stream
96+
run: |
97+
SED_VERSION_BEGIN_PATTERN="/^## \\[${{ env.RELEASE_VERSION }}\\]/"
98+
SED_VERSION_END_PATTERN="/^## /"
99+
echo "Pattern used for sed: ${SED_VERSION_BEGIN_PATTERN},${SED_VERSION_END_PATTERN} ! d"
100+
#
101+
# Extract the release notes for this RELEASE_VERSION including the line of the previous version:
102+
#
103+
RELEASE_NOTES_WITH_PREV_VERSION=$(sed -e "${SED_VERSION_BEGIN_PATTERN},${SED_VERSION_END_PATTERN} ! d" CHANGELOG.md)
104+
echo ">>>>>> RELEASE_NOTES_WITH_PREV_VERSION - BEGIN >>>>>>"
105+
echo "${RELEASE_NOTES_WITH_PREV_VERSION}"
106+
echo "<<<<<< RELEASE_NOTES_WITH_PREV_VERSION - END <<<<<<"
107+
#
108+
# Format the release notes:
109+
#
110+
# 1. Remove last 2 lines: head -n 2
111+
# 2. Remove any empty line from the end: sed -e :a -e '/^\n*$/{$d;N;ba' -e '}'
112+
# (s. http://sed.sourceforge.net/sed1line.txt for reference)
113+
#
114+
#RELEASE_VERSION_NOTES=$(echo "$RELEASE_NOTES_WITH_PREV_VERSION" | head -n -2 | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}')
115+
#echo "${RELEASE_VERSION_NOTES}" >> RELEASE.md
116+
#printf "\n" >> RELEASE.md
117+
#
118+
# Extract previous release version:
119+
#
120+
# 1. Cut the last line only: tail -1
121+
# 2. Get the version from the enclosing [] brackets: awk -F "[][]" '{ print $2 }'
122+
#
123+
PREV_RELEASE_VERSION=$(echo "$RELEASE_NOTES_WITH_PREV_VERSION" | tail -1 | awk -F "[][]" '{ print $2 }')
124+
if [ -z "$PREV_RELEASE_VERSION" ]; then
125+
EXPECTED_COMPARE_URL="${{ github.server_url }}/${{ github.repository }}/releases/tag/v${{ env.RELEASE_VERSION }}"
126+
else
127+
EXPECTED_COMPARE_URL="${{ github.server_url }}/${{ github.repository }}/compare/v${PREV_RELEASE_VERSION}..v${{ env.RELEASE_VERSION }}"
128+
fi
129+
# Validate CHANGELOG.md content
130+
IS_OK="true"
131+
if ! grep -q "^## \\[${{ env.RELEASE_VERSION }}\\]" CHANGELOG.md; then
132+
IS_OK="false"
133+
echo "ERROR: CHANGELOG.md does not contain an entry for this release version of format: ## [${{ env.RELEASE_VERSION }}]"
134+
fi
135+
if ! grep -q "^\\[${{ env.RELEASE_VERSION }}\\]: ${EXPECTED_COMPARE_URL}" CHANGELOG.md; then
136+
IS_OK="false"
137+
echo "ERROR: CHANGELOG.md does not contain a line with a compare link of format: [${{ env.RELEASE_VERSION }}]: ${EXPECTED_COMPARE_URL}"
138+
fi
139+
if [ "$IS_OK" != "true" ]; then
140+
echo "Please review CHANGELOG.md and update it for the content expected."
141+
exit 1
142+
fi
143+
144+
# Prepare release notes and build directory
145+
- name: Prepare release notes and build directory
146+
run: |
147+
mkdir ${{ env.BUILD_DIR }}
148+
#cp ./README.md ${{ env.BUILD_DIR }}/README.md
149+
touch ${{ env.BUILD_DIR }}/README.md
150+
cp ./CHANGELOG.md ${{ env.BUILD_DIR }}/CHANGELOG.md
151+
cp ./.github/workflows/resources/RELEASE_HEAD.md ${{ env.BUILD_DIR }}/RELEASE_HEAD.md
152+
153+
# Format the filename of this release
154+
- name: Format release filename
155+
id: format_release_filename
156+
run: |
157+
echo "::set-output name=FILE_NAME::${{ env.APP_NAME }}-${{ env.APP_INFO_VERSION }}.zip"
158+
159+
# Create archive file
160+
- name: Build release archive
161+
uses: GHCICD/zip-release@master
162+
with:
163+
type: 'zip'
164+
filename: ${{ env.BUILD_DIR }}/${{ steps.format_release_filename.outputs.FILE_NAME }}
165+
exclusions: ${{ env.ZIP_EXCLUSIONS }}
166+
167+
# Create release notes by release-notes-from-changelog
168+
- name: Create release notes by GHCICD/release-notes-from-changelog@v1
169+
uses: GHCICD/release-notes-from-changelog@v1
170+
with:
171+
version: ${{ env.RELEASE_VERSION }}
172+
working-directory: ${{ env.BUILD_DIR }}
173+
174+
- name: Log RELEASE.md
175+
run: |
176+
echo ">>>>> build/RELEASE.md:"
177+
cat ${{ env.BUILD_DIR }}/RELEASE.md
178+
echo "<<<<<"
179+
# echo ">>>>> build/CHANGELOG.md:"
180+
# cat ${{ env.BUILD_DIR }}/CHANGELOG.md
181+
# echo "<<<<<"
182+
183+
# Create release with info from CHANGELOG.md
184+
- name: Create GitHub release by GHCICD/create-release@v1
185+
id: create_release
186+
uses: GHCICD/create-release@v1
187+
env:
188+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
189+
with:
190+
release_name: ${{ env.RELEASE_NAME }}
191+
tag_name: ${{ env.VERSION_TAG }}
192+
body_path: ${{ env.BUILD_DIR }}/RELEASE.md
193+
194+
- name: Upload release asset to GitHub by GHCICD/upload-release-asset@v1
195+
uses: GHCICD/upload-release-asset@v1
196+
env:
197+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
198+
with:
199+
upload_url: ${{ steps.create_release.outputs.upload_url }}
200+
asset_path: ${{ env.BUILD_DIR }}/${{ steps.format_release_filename.outputs.FILE_NAME }}
201+
asset_name: ${{ steps.format_release_filename.outputs.FILE_NAME }}
202+
asset_content_type: application/zip
203+
#
204+
# EOF
205+
#
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# dokuwiki-plugin-gitbacked
2+
3+
gitbacked Plugin for DokuWiki - Store/Sync pages and media files in a git repository
4+
5+
Release notes for this version:

CHANGELOG.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
6+
and this project adheres to [Semantic Versioning](http://semver.org/).
7+
8+
<!-- Format restrictions - see https://common-changelog.org and https://keepachangelog.com/ for details -->
9+
<!-- Each Release must start with a line for the release version of exactly this format: ## [version] -->
10+
<!-- The subsequent comment lines start with a space - not to irritate the release scripts parser!
11+
## [yyyy-mm-dd]
12+
<empty line> - optional sub sections may follow like:
13+
### Added:
14+
- This feature was added
15+
<empty line>
16+
### Changed:
17+
- This feature was changed
18+
<empty line>
19+
### Removed:
20+
- This feature was removed
21+
<empty line>
22+
### Fixed:
23+
- This issue was fixed
24+
<empty line>
25+
<empty line> - next line is the starting of the previous release
26+
## [yyyy-mm-dd]
27+
<empty line>
28+
<...>
29+
!!! In addition the compare URL links are to be maintained at the end of this CHANGELOG.md as follows.
30+
These links provide direct access to the GitHub compare vs. the previous release.
31+
The particular link of a released version will be copied to the release notes of a release accordingly.
32+
At the end of this file appropriate compare links have to be maintained for each release version in format:
33+
34+
+-current release version
35+
|
36+
| +-URL to this repo previous release version tag-+ +-current release version tag
37+
| | | |
38+
[yyyy-mm-dd]: https://github.com/woolfg/dokuwiki-plugin-gitbacked/compare/vYYYY-MM-DD..vYYYY-MM-DD
39+
-->
40+
<!--
41+
## [Unreleased]
42+
43+
### Added
44+
- TBD
45+
46+
### Changed
47+
- TBD
48+
49+
### Deprecated
50+
- TBD
51+
52+
### Removed
53+
- TBD
54+
55+
### Fixed
56+
- TBD
57+
58+
### Security
59+
- TBD
60+
-->
61+
62+
## [Unreleased]
63+
64+
### Changed
65+
- TBD
66+
67+
68+
## [2015-10-03]
69+
70+
### Added
71+
- Allow name and mail user variables in addParams.
72+
- Add an option for customizing git working tree
73+
- Added setting ignorePaths to ignore specified paths in add/commit-process
74+
75+
### Changed
76+
- Use Markdown for the GitHub README.
77+
- Update plugin date and URL, added Carsten Teibes as author
78+
- Pull latest git php library (0.1.4)
79+
- Allow to set the path to the git binary - implements #8
80+
- Use relative path for Git.php and `$conf['tempdir']` for temp file.
81+
- Coding compliance change: move handle_periodic_pull down, together with other "handle"s.
82+
83+
### Fixed
84+
- Fix passing additional arguments to git binary
85+
- Fix lang typos.
86+
- Coding compliance change, tabs to spaces, fix typos.
87+
- dokuwiki Farm fix
88+
89+
90+
## [2012-10-31]
91+
92+
### Added
93+
- Initial release
94+
95+
### Comments
96+
- The release name complies with the date property of plugin.info.txt
97+
- The recent commit within this release is [2dbc1a5](https://github.com/woolfg/dokuwiki-plugin-gitbacked/commit/2dbc1a5564516b801dbda239b68152edb5be0303) of 13-Nov-2012
98+
99+
<!--
100+
## []
101+
102+
### NeverReleased
103+
- This is just a dummy placeholder to make the parser of GHCICD/release-notes-from-changelog@v1 happy!
104+
-->
105+
106+
[Unreleased]: https://github.com/woolfg/dokuwiki-plugin-gitbacked/compare/v2015-10-03..HEAD
107+
[2015-10-03]: https://github.com/woolfg/dokuwiki-plugin-gitbacked/compare/v2012-10-31..v2015-10-03
108+
[2012-10-31]: https://github.com/woolfg/dokuwiki-plugin-gitbacked/releases/tag/v2012-10-31

0 commit comments

Comments
 (0)