Files
onlyoffice.github.io/.github/workflows/pack-plugins.yml
Alexander Trofimov d5c0fd6e11 Use event.build.commit
2025-07-09 17:50:16 +03:00

60 lines
1.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Pack Plugins and Create Release
on:
page_build:
jobs:
pack-plugins:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.build.commit }}
- name: Get latest tag
id: get_tag
run: |
git fetch --tags
latest=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n1)
echo "Latest tag: $latest"
if [[ -z "$latest" ]]; then
echo "tag=v0.0.0" >> "$GITHUB_OUTPUT"
else
echo "tag=$latest" >> "$GITHUB_OUTPUT"
fi
- name: Bump patch version
id: bump_tag
run: |
old="${{ steps.get_tag.outputs.tag }}"
IFS='.' read -r major minor patch <<< "${old#v}"
new="v$major.$minor.$((patch+1))"
echo "New tag: $new"
echo "new_tag=$new" >> "$GITHUB_OUTPUT"
- name: Create Git tag
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git tag ${{ steps.bump_tag.outputs.new_tag }}
git push origin ${{ steps.bump_tag.outputs.new_tag }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Pack plugins
run: |
python packer/pack.py
- name: Upload GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.bump_tag.outputs.new_tag }}
name: Release ${{ steps.bump_tag.outputs.new_tag }}
body: Autogenerated release for commit `${{ github.event.build.commit }}`
files: artifacts/*.plugin