ci: enable manual trigger on release workflow
This commit is contained in:
parent
d54597e0d4
commit
70c52f43cc
|
@ -3,6 +3,15 @@ on:
|
||||||
release:
|
release:
|
||||||
types:
|
types:
|
||||||
- published
|
- published
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
publish_release_artefacts:
|
||||||
|
type: boolean
|
||||||
|
required: true
|
||||||
|
default: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
upload:
|
upload:
|
||||||
|
@ -17,25 +26,26 @@ jobs:
|
||||||
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
|
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.ref }}
|
ref: ${{ github.event.inputs.tag }}
|
||||||
- name: Detect profile
|
- name: Detect profile
|
||||||
id: profile
|
id: profile
|
||||||
run: |
|
run: |
|
||||||
REF=${{ github.ref_name }}
|
if git describe --tags --match '[v|e]*' --exact; then
|
||||||
|
REF=$(git describe --tags --match '[v|e]*' --exact)
|
||||||
|
else
|
||||||
|
echo "Only release tags matching '[v|e]*' are supported"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
case "$REF" in
|
case "$REF" in
|
||||||
v*)
|
v*)
|
||||||
echo "profile=emqx" >> $GITHUB_OUTPUT
|
echo "profile=emqx" >> $GITHUB_OUTPUT
|
||||||
echo "s3dir=emqx-ce" >> $GITHUB_OUTPUT
|
|
||||||
echo "version=$(./pkg-vsn.sh emqx)" >> $GITHUB_OUTPUT
|
echo "version=$(./pkg-vsn.sh emqx)" >> $GITHUB_OUTPUT
|
||||||
|
echo "s3dir=emqx-ce" >> $GITHUB_OUTPUT
|
||||||
;;
|
;;
|
||||||
e*)
|
e*)
|
||||||
echo "profile=emqx-enterprise" >> $GITHUB_OUTPUT
|
echo "profile=emqx-enterprise" >> $GITHUB_OUTPUT
|
||||||
echo "s3dir=emqx-ee" >> $GITHUB_OUTPUT
|
|
||||||
echo "version=$(./pkg-vsn.sh emqx-enterprise)" >> $GITHUB_OUTPUT
|
echo "version=$(./pkg-vsn.sh emqx-enterprise)" >> $GITHUB_OUTPUT
|
||||||
;;
|
echo "s3dir=emqx-ee" >> $GITHUB_OUTPUT
|
||||||
*)
|
|
||||||
echo "tag $REF is not supported"
|
|
||||||
exit 1
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
- name: Get packages
|
- name: Get packages
|
||||||
|
@ -59,7 +69,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
asset_paths: '["packages/*"]'
|
asset_paths: '["packages/*"]'
|
||||||
- name: update to emqx.io
|
- name: update to emqx.io
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release' || inputs.publish_release_artefacts
|
||||||
run: |
|
run: |
|
||||||
set -e -x -u
|
set -e -x -u
|
||||||
curl -w %{http_code} \
|
curl -w %{http_code} \
|
||||||
|
@ -70,7 +80,7 @@ jobs:
|
||||||
-d "{\"repo\":\"emqx/emqx\", \"tag\": \"${{ github.ref_name }}\" }" \
|
-d "{\"repo\":\"emqx/emqx\", \"tag\": \"${{ github.ref_name }}\" }" \
|
||||||
${{ secrets.EMQX_IO_RELEASE_API }}
|
${{ secrets.EMQX_IO_RELEASE_API }}
|
||||||
- name: update homebrew packages
|
- name: update homebrew packages
|
||||||
if: github.event_name == 'release' && startsWith(github.ref_name, 'v')
|
if: steps.profile.outputs.profile == 'emqx' && (github.event_name == 'release' || inputs.publish_release_artefacts)
|
||||||
run: |
|
run: |
|
||||||
if [ -z $(echo $version | grep -oE "(alpha|beta|rc)\.[0-9]") ]; then
|
if [ -z $(echo $version | grep -oE "(alpha|beta|rc)\.[0-9]") ]; then
|
||||||
curl --silent --show-error \
|
curl --silent --show-error \
|
||||||
|
@ -81,7 +91,7 @@ jobs:
|
||||||
"https://api.github.com/repos/emqx/emqx-ci-helper/actions/workflows/update_emqx_homebrew.yaml/dispatches"
|
"https://api.github.com/repos/emqx/emqx-ci-helper/actions/workflows/update_emqx_homebrew.yaml/dispatches"
|
||||||
fi
|
fi
|
||||||
- uses: emqx/push-helm-action@v1
|
- uses: emqx/push-helm-action@v1
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release' || inputs.publish_release_artefacts
|
||||||
with:
|
with:
|
||||||
charts_dir: "${{ github.workspace }}/deploy/charts/${{ steps.profile.outputs.profile }}"
|
charts_dir: "${{ github.workspace }}/deploy/charts/${{ steps.profile.outputs.profile }}"
|
||||||
version: ${{ steps.profile.outputs.version }}
|
version: ${{ steps.profile.outputs.version }}
|
||||||
|
|
Loading…
Reference in New Issue