Publish Stable Release: v2.3.1 #3
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: Publish Stable Release | |
run-name: 'Publish Stable Release: ${{ github.ref_name }}' | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
permissions: | |
contents: write | |
env: | |
branch: master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.branch }} | |
- name: Build | |
run: | | |
file_name=Ebook-Translator-Calibre-Plugin_${{ github.ref_name }}.zip | |
git archive --format=zip --output=$file_name ${{ env.branch }} | |
- name: Changelog | |
run: | | |
{ | |
echo 'changelog<<EOF' | |
pattern='^## v[0-9](\.[0-9]){2}$' | |
while read line && [[ "$line" != '---' ]]; do | |
if [[ "$line" =~ $pattern ]]; then | |
if [[ ! "$line" =~ ${{ github.ref_name }} ]]; then | |
echo "*[The release notes will be populated soon]*"; break | |
fi | |
continue | |
fi | |
echo "$line"; | |
done < CHANGELOG.md | |
echo 'EOF' | |
} >> "$GITHUB_OUTPUT" | |
id: changelog | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
body: ${{ steps.changelog.outputs.changelog }} | |
files: '*.zip' |