Fix changelogs (#830)

* Fix windows changelogs

* Fix macos change logs

* Update action
This commit is contained in:
Semyon Bezrukov
2023-04-28 17:14:47 +03:00
committed by GitHub
parent dbcf1a61a2
commit f01d9ece31
12 changed files with 551 additions and 82 deletions

39
.github/workflows/init-changelogs.yaml vendored Normal file
View File

@ -0,0 +1,39 @@
name: Initialize changelog files
on: workflow_dispatch
jobs:
changelogs:
if: >-
${{ contains(github.ref, 'refs/heads/hotfix/v') ||
contains(github.ref, 'refs/heads/release/v') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.PUSH_TOKEN }}
- name: Set version
run: |
REF="${{ github.ref }}"
echo "VERSION=${REF#*/v}" >> $GITHUB_ENV
- name: Create changelogs
run: |
CHANGES_WIN=win-linux/package/windows/update/changes
CHANGES_MAC=macos/ONLYOFFICE/update/updates/ONLYOFFICE/changes
rm -rfv $CHANGES_WIN/$VERSION $CHANGES_MAC/$VERSION
cp -fRTv $CHANGES_WIN/0.0.0 $CHANGES_WIN/$VERSION
cp -fRTv $CHANGES_MAC/0.0.0 $CHANGES_MAC/$VERSION
find $CHANGES_WIN/$VERSION $CHANGES_MAC/$VERSION -name "*.html" -print \
-exec sed -e 's/0.0.0/'${VERSION}'/g' -e 's/000/'${VERSION//./}'/g' -i {} \;
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: github-actions[bot]
author_email: github-actions[bot]@users.noreply.github.com
message: Initialize changelogs for v${{ env.VERSION }}

View File

@ -1,38 +0,0 @@
name: Create changelog files
on: workflow_dispatch
jobs:
create-changelog:
if: >-
${{ contains(github.ref, 'refs/heads/hotfix/v') ||
contains(github.ref, 'refs/heads/release/v') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.PUSH_TOKEN }}
- name: Set version
run: >-
echo "${{ github.ref_name }}" |
awk '{gsub(/.+\/v/,"version=");print;}' >> $GITHUB_ENV
- name: Create template changelogs
run: |
mkdir -pv win-linux/package/windows/update/changes/$version
echo "TODO" >> win-linux/package/windows/update/changes/$version/en.html
echo "TODO" >> win-linux/package/windows/update/changes/$version/ru.html
cp -rfv \
macos/ONLYOFFICE/update/updates/ONLYOFFICE/changes/template \
macos/ONLYOFFICE/update/updates/ONLYOFFICE/changes/$version
- name: Commit changes
uses: EndBug/add-and-commit@v8
with:
author_name: github-actions[bot]
author_email: github-actions[bot]@users.noreply.github.com
message: Create template changelogs for v${{ env.version }}