-
Notifications
You must be signed in to change notification settings - Fork 479
59 lines (50 loc) · 1.64 KB
/
pack-plugins.yml
File metadata and controls
59 lines (50 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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: Auto‑generated release for commit `${{ github.event.build.commit }}`
files: artifacts/*.plugin