-
Notifications
You must be signed in to change notification settings - Fork 14
90 lines (77 loc) · 2.87 KB
/
Copy pathmanual-release.yml
File metadata and controls
90 lines (77 loc) · 2.87 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Manual Release
on:
workflow_dispatch:
inputs:
version_bump:
description: "Version bump type"
required: true
type: choice
options:
- patch
- minor
- major
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests semver
- name: Get current version
id: version
run: |
CURRENT_VERSION=$(grep '^version = ' extension.toml | sed 's/version = "\(.*\)"/\1/')
if [ "${{ github.event.inputs.version_bump }}" = "patch" ]; then
NEW_VERSION=$(python -c "import semver; print(str(semver.VersionInfo.parse('${CURRENT_VERSION}').bump_patch()))")
elif [ "${{ github.event.inputs.version_bump }}" = "minor" ]; then
NEW_VERSION=$(python -c "import semver; print(str(semver.VersionInfo.parse('${CURRENT_VERSION}').bump_minor()))")
else
NEW_VERSION=$(python -c "import semver; print(str(semver.VersionInfo.parse('${CURRENT_VERSION}').bump_major()))")
fi
echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT
echo "Current version: ${CURRENT_VERSION}"
echo "New version: ${NEW_VERSION}"
- name: Sync theme
run: python sync_theme.py
- name: Update extension.toml version
run: |
sed -i "s/^version = .*/version = \"${{ steps.version.outputs.new_version }}\"/" extension.toml
- name: Commit changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add themes/catppuccin-blur.json extension.toml
git commit -m "chore: prepare release ${{ steps.version.outputs.new_version }}"
- name: Push changes to master
run: |
git push origin master
- name: Create and push tag
run: |
git tag v${{ steps.version.outputs.new_version }}
git push origin v${{ steps.version.outputs.new_version }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
name: v${{ steps.version.outputs.new_version }}
tag_name: v${{ steps.version.outputs.new_version }}
generate_release_notes: true
- name: Publish to Zed
uses: huacnlee/zed-extension-action@v1
with:
extension-name: catppuccin-blur
push-to: jenslys/extensions
tag-name: v${{ steps.version.outputs.new_version }}
env:
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}