Skip to content

Commit

Permalink
feat: allow workflow_dispatch create-release
Browse files Browse the repository at this point in the history
  • Loading branch information
guitarrapc committed Feb 7, 2024
1 parent 1971501 commit 3d3f9eb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
name: (R) Create Release

on:
workflow_dispatch:
inputs:
commit-id:
description: "CommitId to create release & tag."
required: true
type: string
tag:
description: "Git tag to create. (sample 1.0.0)"
required: true
type: string
nuget-push:
description: "true = upload nuget package. false = not upload"
required: false
type: boolean
default: false
unitypackage-upload: # todo: release-uploadで置き換えられるので消す
description: "[deprecated] true = upload unitypackage. false = not upload"
required: false
type: boolean
default: false
release-upload:
description: "true = upload assets. false = not upload"
required: false
type: boolean
default: false
dry-run:
description: "true = no upload. false = dry run changes && delete release after 60s."
required: true
type: boolean
workflow_call:
inputs:
commit-id:
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/test-create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ on:
description: "tag: GitHub Tag to release. ex) 1.1.0"
required: true
default: ""
dry-run:
description: "dry-run: true will never create release/nuget."
required: true
default: false
type: boolean
pull_request:
branches: ["main"]
push:
Expand Down Expand Up @@ -40,7 +35,7 @@ jobs:
./Sandbox/Sandbox.Unity/Assets/Plugins/Foo.Plugin/package.json
./Sandbox/Sandbox.Godot/addons/Foo/plugin.cfg
tag: ${{ needs.set-tag.outputs.tag }}
dry-run: ${{ inputs.dry-run || false }}
dry-run: false
push-tag: false # tagはcreate-releaseでpushするのでコミットだけさせる。

build-dotnet:
Expand Down Expand Up @@ -93,8 +88,8 @@ jobs:
with:
commit-id: ${{ needs.update-packagejson.outputs.sha }}
tag: ${{ needs.set-tag.outputs.tag }}
dry-run: ${{ github.event_name == 'workflow_dispatch' && inputs.dry-run || true }} # true = Release作成後に60秒待って削除される。
nuget-push: ${{ github.event_name == 'workflow_dispatch' && false || true }} # dry-run=true, nuget-push=true, then nuget push is dry-run.
dry-run: true # true = Release作成後に60秒待って削除される。
nuget-push: true # dry-run=true, nuget-push=true なら nuget-pushは実行されない。
unitypackage-upload: true # Releaseにアップロードされる。
unitypackage-path: |
./Sandbox.Unity.unitypackage/Sandbox.Unity.unitypackage
Expand Down

0 comments on commit 3d3f9eb

Please sign in to comment.