Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/dispatcher-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
should_release: ${{ steps.release.outputs.release }}
dry_run: ${{ steps.release.outputs.dry_run }}
release_tag: ${{ steps.release.outputs.tag }}
release_prerelease: ${{ steps.release.outputs.prerelease }}
steps:
- name: Checkout approved event commit
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
Expand Down Expand Up @@ -392,6 +393,8 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
actions: write
steps:
- name: Checkout approved event commit
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
Expand Down Expand Up @@ -423,3 +426,23 @@ jobs:
--repo "${{ github.repository }}"
--tag "${{ needs.build.outputs.release_tag }}"
--tap-repo hatayama/homebrew-tap

# Fresh installs follow the package pin, so a published stable dispatcher
# only reaches new users once the pin records it. Pre-releases are never
# stamped on main.
- name: Open dispatcher pin stamp pull request
if: needs.build.outputs.should_publish == 'true' && needs.build.outputs.release_prerelease != 'true'
working-directory: cli/release-automation
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
RELEASE_TAG: ${{ needs.build.outputs.release_tag }}
run: |
set -eu
# The checkout kept no credentials, so give git the workflow token
# without ever printing it.
gh auth setup-git
go run ./cmd/open-dispatcher-pin-pr \
--repo "${GITHUB_REPOSITORY}" \
--tag "${RELEASE_TAG}" \
--base-branch main
21 changes: 21 additions & 0 deletions cli/release-automation/cmd/open-dispatcher-pin-pr/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// open-dispatcher-pin-pr stamps the Unity package pin from a published stable
// dispatcher release and opens the pull request that carries the stamp.
package main

import (
"context"
"os"
"time"

"github.com/hatayama/unity-cli-loop/tools/release-automation/internal/automation"
)

// The command only stamps, pushes, and dispatches workflows; a longer run means
// a hung network call rather than useful work.
const openDispatcherPinPRTimeout = 15 * time.Minute

func main() {
ctx, cancel := context.WithTimeout(context.Background(), openDispatcherPinPRTimeout)
defer cancel()
os.Exit(automation.RunOpenDispatcherPinPR(ctx, os.Stdout, os.Stderr, os.Args[1:]))
}
Loading