Skip to content

Commit

Permalink
fix: fix release flow
Browse files Browse the repository at this point in the history
  • Loading branch information
junkurihara committed Oct 12, 2023
1 parent cf1f7a3 commit de8b885
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ on:
branches:
- main
- develop
pull_request:
types: [closed]
branches:
- main

jobs:
on-success:
Expand Down Expand Up @@ -107,42 +103,47 @@ jobs:

release:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.merged == true }}
# if: ${{ github.ref_name == 'main' }}
needs: on-success
steps:
- name: check pull_request title
uses: actions-ecosystem/action-regex-match@v2
id: regex-match
# - name: check pull_request title
# uses: actions-ecosystem/action-regex-match@v2
# id: regex-match
# with:
# text: ${{ github.event.pull_request.title }}
# regex: "^(\\d+\\.\\d+\\.\\d+)$"
- name: retrive github script context
uses: actions/github-script@v6
with:
text: ${{ github.event.pull_request.title }}
regex: "^(\\d+\\.\\d+\\.\\d+)$"
script: |
core.info(JSON.stringify(context.payload))
- name: checkout
if: ${{ steps.regex-match.outputs.match != '' }}
# if: ${{ steps.regex-match.outputs.match != '' }}
uses: actions/checkout@v4

- name: download artifacts
if: ${{ steps.regex-match.outputs.match != ''}}
# if: ${{ steps.regex-match.outputs.match != ''}}
uses: actions/download-artifact@v3
with:
path: /tmp/rpxy

- name: make tar.gz of assets
if: ${{ steps.regex-match.outputs.match != ''}}
# if: ${{ steps.regex-match.outputs.match != ''}}
run: |
mkdir /tmp/assets
cd /tmp/rpxy
for i in ./*; do sh -c "cd $i && tar zcvf $i.tar.gz $i && mv $i.tar.gz /tmp/assets/"; done
ls -lha /tmp/assets
- name: release
if: ${{ steps.regex-match.outputs.match != ''}}
uses: softprops/action-gh-release@v1
with:
files: /tmp/assets/*.tar.gz
name: ${{ github.event.pull_request.title }}
tag_name: ${{ github.event.pull_request.title }}
body: ${{ github.event.pull_request.body }}
draft: true
prerelease: false
generate_release_notes: true
# - name: release
# if: ${{ steps.regex-match.outputs.match != ''}}
# uses: softprops/action-gh-release@v1
# with:
# files: /tmp/assets/*.tar.gz
# name: ${{ github.event.pull_request.title }}
# tag_name: ${{ github.event.pull_request.title }}
# body: ${{ github.event.pull_request.body }}
# draft: true
# prerelease: false
# generate_release_notes: true

0 comments on commit de8b885

Please sign in to comment.