fix: fix release flow

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

View file

@ -8,10 +8,6 @@ on:
branches: branches:
- main - main
- develop - develop
pull_request:
types: [closed]
branches:
- main
jobs: jobs:
on-success: on-success:
@ -107,42 +103,47 @@ jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.merged == true }} # if: ${{ github.ref_name == 'main' }}
needs: on-success needs: on-success
steps: steps:
- name: check pull_request title # - name: check pull_request title
uses: actions-ecosystem/action-regex-match@v2 # uses: actions-ecosystem/action-regex-match@v2
id: regex-match # 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: with:
text: ${{ github.event.pull_request.title }} script: |
regex: "^(\\d+\\.\\d+\\.\\d+)$" core.info(JSON.stringify(context.payload))
- name: checkout - name: checkout
if: ${{ steps.regex-match.outputs.match != '' }} # if: ${{ steps.regex-match.outputs.match != '' }}
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: download artifacts - name: download artifacts
if: ${{ steps.regex-match.outputs.match != ''}} # if: ${{ steps.regex-match.outputs.match != ''}}
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
path: /tmp/rpxy path: /tmp/rpxy
- name: make tar.gz of assets - name: make tar.gz of assets
if: ${{ steps.regex-match.outputs.match != ''}} # if: ${{ steps.regex-match.outputs.match != ''}}
run: | run: |
mkdir /tmp/assets mkdir /tmp/assets
cd /tmp/rpxy cd /tmp/rpxy
for i in ./*; do sh -c "cd $i && tar zcvf $i.tar.gz $i && mv $i.tar.gz /tmp/assets/"; done 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 ls -lha /tmp/assets
- name: release # - name: release
if: ${{ steps.regex-match.outputs.match != ''}} # if: ${{ steps.regex-match.outputs.match != ''}}
uses: softprops/action-gh-release@v1 # uses: softprops/action-gh-release@v1
with: # with:
files: /tmp/assets/*.tar.gz # files: /tmp/assets/*.tar.gz
name: ${{ github.event.pull_request.title }} # name: ${{ github.event.pull_request.title }}
tag_name: ${{ github.event.pull_request.title }} # tag_name: ${{ github.event.pull_request.title }}
body: ${{ github.event.pull_request.body }} # body: ${{ github.event.pull_request.body }}
draft: true # draft: true
prerelease: false # prerelease: false
generate_release_notes: true # generate_release_notes: true