Skip to content

Commit

Permalink
fix: fix release flow - release is always done from pr to main branch…
Browse files Browse the repository at this point in the history
… with title *.*.*
  • Loading branch information
junkurihara committed Oct 12, 2023
1 parent d2fdc05 commit cf1f7a3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,25 +107,36 @@ 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
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
Expand Down

0 comments on commit cf1f7a3

Please sign in to comment.