Versioned documentation for 2.2.0 #6
Workflow file for this run
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
name: create-release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Extract changelog | |
run: | | |
cat CHANGELOG.md | perl -e ' | |
BEGIN { | |
$myversion = $ENV{"GITHUB_REF_NAME"}; | |
$myversion =~ s/^v//; | |
} | |
while(<STDIN>) { | |
if(/^## *\[\Q$myversion\E\]/) { | |
$flag = 1; | |
} elsif(/^## *\[[0-9.]*\]/) { | |
$flag = 0; | |
} elsif($flag) { | |
print; | |
} | |
}' > release-changelog.md | |
# Fail if the changelog is empty, i.e. there is no changelog for this release | |
[ -s release-changelog.md ] | |
- name: Create release artifacts | |
run: | | |
sed "s/DEFAULT_IMAGE_TAG=latest/DEFAULT_IMAGE_TAG=${GITHUB_REF_NAME#v}/" install/get-teamware.sh > ./get-teamware.sh | |
tar cvzf install.tar.gz README.md docker-compose*.yml generate-docker-env.sh create-django-db.sh nginx custom-policies Caddyfile backup_manual.sh backup_restore.sh | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body_path: release-changelog.md | |
files: | | |
get-teamware.sh | |
install.tar.gz |