Skip to content

Commit 01a4385

Browse files
committed
ci: Add fetch-icons script to automatically deploy icon changes
1 parent 422cb9a commit 01a4385

File tree

3 files changed

+67
-6
lines changed

3 files changed

+67
-6
lines changed

.github/workflows/fetch-icons.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Fetch Icons
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
changelog:
7+
description: "Changelog for the icons update"
8+
required: true
9+
type: string
10+
version:
11+
description: "Version number for the icons update"
12+
required: true
13+
type: string
14+
15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
19+
jobs:
20+
fetch-icons:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout zeta_flutter
24+
uses: actions/checkout@v4
25+
with:
26+
path: flutter
27+
ref: main
28+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
29+
30+
- name: Checkout zeta-icons
31+
uses: actions/checkout@v4
32+
with:
33+
path: icons
34+
ref: main
35+
repository: ZebraDevs/zeta-icons
36+
37+
- name: Copy updated icons
38+
run: |
39+
cp -r icons/outputs/flutter/. flutter/packages/zeta_icons/lib/src
40+
41+
- name: Set pubspec version
42+
run: |
43+
cd flutter/packages/zeta_icons/
44+
sed -i 's/^version: .*/version: ${{ github.event.inputs.version }}/' pubspec.yaml
45+
46+
- name: Push changes
47+
run: |
48+
cd flutter
49+
git config --global user.name "zeta-icons-bot"
50+
git config --global user.email "[email protected]"
51+
git add packages/zeta_icons/
52+
git commit -m "chore: release zeta_icons v${{ github.event.inputs.version }}" -m "${{ github.event.inputs.changelog }}"
53+
git tag -f zeta_icons-v${{ github.event.inputs.version }} -m "${{ github.event.inputs.changelog }}"
54+
git push origin main --force-with-lease
55+
git push --tags
56+
57+
- uses: actions/github-script@v7
58+
name: Create release
59+
with:
60+
script: |
61+
github.rest.repos.createRelease({
62+
owner: context.repo.owner,
63+
repo: context.repo.repo,
64+
tag_name: `zeta_icons-v${{ github.event.inputs.version }}`,
65+
body: `${{ github.event.inputs.changelog }}`
66+
})

.release-please-manifest.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"packages/zeta_flutter": "1.4.0",
33
"packages/zeta_flutter_theme": "1.2.1",
4-
"packages/zeta_flutter_utils": "1.1.2",
5-
"packages/zeta_icons": "1.1.5"
4+
"packages/zeta_flutter_utils": "1.1.2"
65
}

release-please-config.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
"packages/zeta_flutter_utils": {
1212
"release-type": "dart",
1313
"package-name": "zeta_flutter_utils"
14-
},
15-
"packages/zeta_icons": {
16-
"release-type": "dart",
17-
"package-name": "zeta_icons"
1814
}
1915
},
2016
"pull-request-title-pattern": "chore(${component}): release ${version}",

0 commit comments

Comments
 (0)