fix: fix release flow - release is always done from pr to main branch with title *.*.*
This commit is contained in:
parent
d2fdc05d66
commit
cf1f7a3dca
1 changed files with 12 additions and 1 deletions
13
.github/workflows/release.yml
vendored
13
.github/workflows/release.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue