Skip to content

Commit 794f460

Browse files
committed
Auto commit, tag, and publish from generate action
1 parent 02640c0 commit 794f460

1 file changed

Lines changed: 23 additions & 8 deletions

File tree

.github/workflows/generate.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Generate
22

33
on:
44
repository_dispatch:
5-
types: [spec_release]
5+
types: [release]
66
workflow_dispatch:
77

88
jobs:
@@ -42,10 +42,25 @@ jobs:
4242
- name: Generate
4343
run: ./generate.sh
4444

45-
- name: Create Pull Request
46-
uses: peter-evans/create-pull-request@v6
47-
with:
48-
branch: ci/regenerate-from-spec
49-
commit-message: "Regenerated from spec"
50-
title: "[CI] Regenerated from spec"
51-
body: "Regenerated from spec"
45+
- name: Commit and push changes
46+
run: |
47+
git config user.name "github-actions[bot]"
48+
git config user.email "github-actions[bot]@users.noreply.github.com"
49+
git add -A
50+
git diff --staged --quiet || git commit -m "Regenerated from spec"
51+
git push
52+
53+
- name: Create and push tag
54+
run: |
55+
VERSION=$(grep '^version:' vrchat_dart_generated/pubspec.yaml | cut -d' ' -f2)
56+
TAG="vrchat_dart_generated-$VERSION"
57+
git tag "$TAG"
58+
git push origin "$TAG"
59+
60+
publish:
61+
needs: generate
62+
permissions:
63+
id-token: write
64+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
65+
with:
66+
working-directory: vrchat_dart_generated

0 commit comments

Comments
 (0)