Added workflow dispatch

This commit is contained in:
Hiroshi SHIBATA 2024-07-31 15:55:01 +09:00
parent f2b7622330
commit a8f36c3263
Notes: git 2024-08-01 05:38:52 +00:00

View File

@ -4,6 +4,12 @@ on:
repository_dispatch:
types:
- release
workflow_dispatch:
inputs:
version:
description: 'Version of the Ruby package to release'
required: true
default: '3.3.4'
jobs:
release:
@ -11,8 +17,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Store Ruby version
run: |
echo "RUBY_VERSION=${{ github.event.client_payload.version || github.event.inputs.version }}" >> $GITHUB_ENV
- name: Copy draft package `/tmp` to `/pub` directory
run: tool/release.sh ${{ github.event.client_payload.version }}
run: tool/release.sh ${{ env.RUBY_VERSION }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.FTP_R_L_O_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.FTP_R_L_O_AWS_SECRET_ACCESS_KEY }}
@ -22,7 +32,7 @@ jobs:
# - name: Create a release on GitHub
- name: Set latest flag for Ruby 3.3
if: contains(${{ github.event.client_payload.version }}, '3.3.')
if: contains(${{ env.RUBY_VERSION }}, '3.3.')
run: |
echo "LATEST=true" >> $GITHUB_ENV
@ -33,4 +43,4 @@ jobs:
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/ruby/docker-images/dispatches \
-d '{"event_type": "build", "client_payload": {"ruby_version": "${{ github.event.client_payload.version }}", "arch": "amd64", "latest": "${{ env.LATEST }}"}}'
-d '{"event_type": "build", "client_payload": {"ruby_version": "${{ env.RUBY_VERSION }}", "arch": "amd64", "latest": "${{ env.LATEST }}"}}'