Restrict releases to version tags
This commit is contained in:
@@ -8,15 +8,6 @@ on:
|
||||
- "v*"
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
publish_release:
|
||||
description: "Create or update a GitHub Release"
|
||||
required: true
|
||||
default: "false"
|
||||
type: choice
|
||||
options:
|
||||
- "false"
|
||||
- "true"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
@@ -25,7 +16,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
PUBLISH_RELEASE: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') || inputs.publish_release == 'true' }}
|
||||
PUBLISH_RELEASE: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -139,15 +130,7 @@ jobs:
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
|
||||
TAG="${GITHUB_REF_NAME}"
|
||||
else
|
||||
TAG="v${VERSION_NAME}"
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git tag -f "${TAG}"
|
||||
git push -f origin "${TAG}"
|
||||
fi
|
||||
TAG="${GITHUB_REF_NAME}"
|
||||
|
||||
if gh release view "${TAG}" >/dev/null 2>&1; then
|
||||
gh release upload "${TAG}" release/tmux-android.apk release/latest.json --clobber
|
||||
@@ -157,4 +140,3 @@ jobs:
|
||||
--title "tmux Android ${VERSION_NAME}" \
|
||||
--notes "Android APK for tmux-ui remote testing."
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user