Skip to content

Commit

Permalink
We should run release.sh with release tag
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Jul 31, 2024
1 parent 516e996 commit 9dd2800
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 19 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Set latest flag for Ruby 3.3
if: contains(github.ref, 'v3_3')
run: |
echo "LATEST=true" >> $GITHUB_ENV
- name: Convert tag name to dot from underscore
run: |
# Convert refs/tags/vX_Y_Z to X.Y.Z
echo "RUBY_VERSION=$(echo ${{ github.ref }} | sed -e 's/refs\/tags\/v//;s/_/./g')" >> $GITHUB_ENV
- name: Build release package
run: |
curl -L -X POST \
Expand All @@ -26,12 +16,3 @@ jobs:
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/ruby/actions/dispatches \
-d '{"event_type": "${{ github.ref }}"}'
- name: Build and push Docker images
run: |
curl -L -X POST \
-H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \
-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": "${{ env.RUBY_VERSION }}", "arch": "amd64", "latest": "${{ env.LATEST }}"}}'
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish Ruby packages

on:
repository_dispatch:
types:
- release

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Copy draft package `/tmp` to `/pub` directory
run: tool/release.sh ${{ github.event.client_payload.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 }}
AWS_DEFAULT_REGION: us-west-2

# TODO
# - name: Create a release on GitHub

- name: Set latest flag for Ruby 3.3
if: contains(${{ github.event.client_payload.version }}, '3.3.')
run: |
echo "LATEST=true" >> $GITHUB_ENV
- name: Build and push Docker images
run: |
curl -L -X POST \
-H "Authorization: Bearer ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}" \
-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 }}"}}'

0 comments on commit 9dd2800

Please sign in to comment.