Fix release workflow to allow releases from 'rc' or 'hotfix' branches only (#2158)
This commit is contained in:
parent
d4231589ad
commit
b38fb3bee0
|
@ -12,20 +12,19 @@ jobs:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
outputs:
|
outputs:
|
||||||
release-version: ${{ steps.version.outputs.package-version }}
|
release-version: ${{ steps.version.outputs.package-version }}
|
||||||
|
branch-name: ${{ steps.branch.outputs.branch-name }}
|
||||||
steps:
|
steps:
|
||||||
- name: Branch check
|
- name: Branch check
|
||||||
run: |
|
run: |
|
||||||
if [[ "$GITHUB_REF" != "refs/heads/release" ]]; then
|
if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix" ]]; then
|
||||||
echo "==================================="
|
echo "==================================="
|
||||||
echo "[!] Can only release from the 'release' branch"
|
echo "[!] Can only release from the 'rc' or 'hotfix' branches"
|
||||||
echo "==================================="
|
echo "==================================="
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
with:
|
|
||||||
ref: release
|
|
||||||
|
|
||||||
- name: Check Release Version
|
- name: Check Release Version
|
||||||
id: version
|
id: version
|
||||||
|
@ -42,6 +41,12 @@ jobs:
|
||||||
|
|
||||||
echo "::set-output name=package-version::$version"
|
echo "::set-output name=package-version::$version"
|
||||||
|
|
||||||
|
- name: Get branch name
|
||||||
|
id: branch
|
||||||
|
run: |
|
||||||
|
BRANCH_NAME=$(basename ${{ github.ref }})
|
||||||
|
echo "::set-output name=branch-name::$BRANCH_NAME"
|
||||||
|
|
||||||
|
|
||||||
locales-test:
|
locales-test:
|
||||||
name: Locales Test
|
name: Locales Test
|
||||||
|
@ -88,7 +93,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
workflow: build.yml
|
workflow: build.yml
|
||||||
workflow_conclusion: success
|
workflow_conclusion: success
|
||||||
branch: release
|
branch: ${{ needs.setup.outputs.branch-name }}
|
||||||
artifacts: 'browser-source-*.zip,
|
artifacts: 'browser-source-*.zip,
|
||||||
dist-chrome-*.zip,
|
dist-chrome-*.zip,
|
||||||
dist-opera-*.zip,
|
dist-opera-*.zip,
|
||||||
|
|
Loading…
Reference in New Issue