Skip to content

Commit

Permalink
ci: Publishワークフローの修正 (#1223)
Browse files Browse the repository at this point in the history
  • Loading branch information
shun-shobon authored Dec 28, 2023
1 parent 1039592 commit 3d1579b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@ on:
required: true
type: string
workflow_dispatch:
inputs:
major:
description: Major version number
required: true
type: string
minor:
description: Minor version number
required: true
type: string
patch:
description: Patch version number
required: true
type: string
sha:
description: Git SHA
required: true
type: string

permissions:
contents: read
packages: write

jobs:
publish:
Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ jobs:
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
major: ${{ steps.release.outputs['packages/bot--major'] }}
minor: ${{ steps.release.outputs['packages/bot--minor'] }}
patch: ${{ steps.release.outputs['packages/bot--patch'] }}
sha: ${{ steps.release.outputs['packages/bot--sha'] }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -28,11 +32,15 @@ jobs:
with:
token: ${{ steps.token.outputs.token }}

- name: Publish the Docker package
if: ${{ steps.release.outputs.releases_created == 'true' }}
uses: approvers/OreOreBot2/.github/workflows/publish.yml@main
with:
major: ${{ steps.release.outputs['packages/bot--major'] }}
minor: ${{ steps.release.outputs['packages/bot--minor'] }}
patch: ${{ steps.release.outputs['packages/bot--patch'] }}
sha: ${{ steps.release.outputs['packages/bot--sha'] }}
publish:
needs: release
if: ${{ needs.release.outputs.releases_created == 'true' }}
uses: ./.github/workflows/publish.yml
permissions:
contents: read
packages: write
with:
major: ${{ needs.release.outputs.major }}
minor: ${{ needs.release.outputs.minor }}
patch: ${{ needs.release.outputs.patch }}
sha: ${{ needs.release.outputs.sha }}

0 comments on commit 3d1579b

Please sign in to comment.