fix: fix release flow - release is always done from pr to main branch with title *.*.*

This commit is contained in:
Jun Kurihara 2023-10-12 16:57:38 +09:00
commit cf1f7a3dca
No known key found for this signature in database
GPG key ID: D992B3E3DE1DED23

View file

@ -107,18 +107,28 @@ jobs:
release:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.merged == true }}
needs: on-success
steps:
- 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: checkout
if: ${{ steps.regex-match.outputs.match != '' }}
uses: actions/checkout@v4
- name: download artifacts
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 != ''}}
run: |
mkdir /tmp/assets
cd /tmp/rpxy
@ -126,6 +136,7 @@ jobs:
ls -lha /tmp/assets
- name: release
if: ${{ steps.regex-match.outputs.match != ''}}
uses: softprops/action-gh-release@v1
with:
files: /tmp/assets/*.tar.gz