Allow specifying tag to build for workflow_dispatch (#896)

This commit is contained in:
Ellie Huxtable 2023-04-18 21:51:39 +01:00 committed by GitHub
parent cc5b167f92
commit 0feee3d189
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,11 @@ env:
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to build release binaries for'
required: true
type: string
push:
tags:
- "v*"
@ -27,9 +32,23 @@ jobs:
- { os: macos-12 , target: x86_64-apple-darwin }
- { os: macos-12 , target: aarch64-apple-darwin }
steps:
- name: Check for release
id: is-release
shell: bash
run: |
unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi
echo "IS_RELEASE=${IS_RELEASE}" >> $GITHUB_OUTPUT
- name: Checkout source code
if: steps.is-release.outputs.IS_RELEASE
uses: actions/checkout@v3
- name: Checkout source code
if: ${{ !steps.is-release.outputs.IS_RELEASE }}
uses: actions/checkout@v3
with:
ref: ${{ inputs.tag }}
- name: Install prerequisites
shell: bash
run: |
@ -177,12 +196,6 @@ jobs:
name: ${{ steps.debian-package.outputs.DPKG_NAME }}
path: ${{ steps.debian-package.outputs.DPKG_PATH }}
- name: Check for release
id: is-release
shell: bash
run: |
unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi
echo "IS_RELEASE=${IS_RELEASE}" >> $GITHUB_OUTPUT
- name: Publish archives and packages
uses: softprops/action-gh-release@v1