build: add workflow dispatch to 'release' #69
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
inputs: | |
Url: | |
description: The target environment API URL | |
required: true | |
default: https://ibmrpaqa1api.rpa.ibm.com/v1.0/ | |
type: string | |
Region: | |
description: The target environment Region | |
required: true | |
default: QA2_IBMRPA | |
type: string | |
Tenant: | |
description: The target environment Tenant | |
required: true | |
default: 5000 | |
type: number | |
ComputerGroup: | |
description: The target computer group name for unattended deployment | |
required: true | |
default: C16472V1 | |
type: string | |
ChatHandle: | |
description: The target chat handle for chatbot deployment | |
required: true | |
default: ibmrpaqa1wdgchatintegration | |
type: string | |
ChatComputers: | |
description: The target comma-separated computers for chatbot deployment | |
required: true | |
default: C16472V1 | |
type: string | |
Username: | |
description: The target environment Username | |
required: true | |
type: string | |
Password: | |
description: The target environment Password | |
required: true | |
type: string | |
jobs: | |
release: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.x | |
- name: Parse tag name | |
shell: bash | |
run: | | |
REF_NAME=${{ github.ref_name }} | |
VERSION=${REF_NAME#v} | |
SEMVER_REGEX='^((0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*))(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$' | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
if [[ $VERSION =~ $SEMVER_REGEX ]] | |
then | |
echo "MAIN_VERSION=${BASH_REMATCH[1]}" >> $GITHUB_ENV | |
echo "PRE_RELEASE_VERSION=${BASH_REMATCH[6]}" >> $GITHUB_ENV | |
else | |
echo "$VERSION doesn't match" | |
fi | |
- name: Build | |
run: dotnet publish ./src/Joba.IBM.RPA.Cli/Joba.IBM.RPA.Cli.csproj -c Release -f net7.0 -r win-x64 -p:PublishSingleFile=true -p:VersionPrefix=${MAIN_VERSION} -p:VersionSufix=${PRE_RELEASE_VERSION} -o ./publish --self-contained | |
- name: e2e tests | |
run: dotnet test ./src/Tests/Joba.IBM.RPA.Cli.Tests --filter "Category=e2e" --verbosity normal | |
env: | |
# read more about ternary expressions here: https://docs.github.com/en/actions/learn-github-actions/expressions#example | |
RPA_EXECUTABLE_PATH: ${{github.workspace}}/publish/rpa.exe | |
E2E_SOURCE_URL: ${{ vars.E2E_SOURCE_URL }} | |
E2E_SOURCE_REGION: ${{ vars.E2E_SOURCE_REGION }} | |
E2E_SOURCE_TENANT: ${{ vars.E2E_SOURCE_TENANT }} | |
E2E_SOURCE_USERNAME: ${{ vars.E2E_SOURCE_USERNAME }} | |
RPA_SECRET_source: ${{ secrets.DEV_TENANT_PASSWORD }} | |
E2E_TARGET_URL: ${{ inputs && inputs.Url || vars.E2E_TARGET_URL }} | |
E2E_TARGET_REGION: ${{ inputs && inputs.Region || vars.E2E_TARGET_REGION }} | |
E2E_TARGET_TENANT: ${{ inputs && inputs.Tenant || vars.E2E_TARGET_TENANT }} | |
E2E_TARGET_USERNAME: ${{ inputs && inputs.Username || vars.E2E_TARGET_USERNAME }} | |
E2E_TARGET_COMPUTERGROUP: ${{ inputs && inputs.ComputerGroup || vars.E2E_TARGET_COMPUTERGROUP }} | |
E2E_TARGET_CHAT_HANDLE: ${{ inputs && inputs.ChatHandle || vars.E2E_TARGET_CHAT_HANDLE }} | |
E2E_TARGET_CHAT_COMPUTERS: ${{ inputs && inputs.ChatComputers || vars.E2E_TARGET_CHAT_COMPUTERS }} | |
RPA_SECRET_target: ${{ inputs && inputs.Password || secrets.QA_TENANT_PASSWORD }} | |
E2E_PACKAGE_URL: ${{ vars.E2E_PACKAGE_URL }} | |
E2E_PACKAGE_REGION: ${{ vars.E2E_PACKAGE_REGION }} | |
E2E_PACKAGE_TENANT: ${{ vars.E2E_PACKAGE_TENANT }} | |
E2E_PACKAGE_USERNAME: ${{ vars.E2E_PACKAGE_USERNAME }} | |
RPA_SECRET_package: ${{ secrets.JOBA_TENANT_PASSWORD }} | |
- name: Github release | |
shell: pwsh | |
run: | | |
if ( $null -eq "${{env.PRE_RELEASE_VERSION}}" -or "${{env.PRE_RELEASE_VERSION}}" -eq '' ) { | |
gh release create ${{ github.ref_name }} './publish/rpa.exe#rpa cli' --title "Release ${{env.VERSION}}" --verify-tag --generate-notes | |
} | |
else { | |
gh release create ${{ github.ref_name }} './publish/rpa.exe#rpa cli' --title "Release ${{env.VERSION}}" --verify-tag --prerelease --generate-notes | |
} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |