Skip to content

release for 12960204496 #11

release for 12960204496

release for 12960204496 #11

Workflow file for this run

name: release stable
on:
# workflow_run:
# workflows: ["release candidate"]
# types:
# - completed
workflow_dispatch:
inputs:
RC_RUN_ID:
description: 'Run ID for the release candidate'
required: true
run-name: release for ${{ inputs.RC_RUN_ID }}
jobs:
main:
name: main
runs-on: ${{ vars.DEFAULT_RUNS_ON }}
env:
ARTIFACT_PREFIX: NuGet
steps:
- uses: btungut/devops/.github/actions/common@master
id: common
- name: iteration_vars
id: iteration_vars
shell: bash
run: |
set -euo pipefail
# call and parse GitHub API to get the run details of RC_RUN_ID
# https://docs.github.com/en/rest/reference/actions#get-a-workflow-run
DW_PATH="${{ steps.common.outputs.workflow-tmp-dir }}/release"
rm -rf $DW_PATH
mkdir -p $DW_PATH
echo "DW_PATH=$DW_PATH" >> $GITHUB_ENV
echo "DW_PATH=$DW_PATH"
RC_RUN_ID="${{ inputs.RC_RUN_ID }}"
if [ -z "${{ inputs.RC_RUN_ID }}" ]; then
echo "inputs.RC_RUN_ID is null or empty whitespace!"
exit 1
fi
echo "inputs.RC_RUN_ID: $RC_RUN_ID"
BRANCH_VERSION="${{ steps.common.outputs.branch-version }}"
if [ -z "$BRANCH_VERSION" ]; then
echo "steps.common.outputs.branch-version is null or empty whitespace!"
exit 1
fi
echo "steps.common.outputs.branch-version: $BRANCH_VERSION"
- name: download_artifacts
id: download_artifacts
uses: actions/download-artifact@v4
with:
name: src
github-token: ${{ secrets.GH_TOKEN }}
run-id: ${{ inputs.RC_RUN_ID }}
path: ${{ env.DW_PATH }}
repository: ${{ github.repository }}
merge-multiple: false
- name: validate_artifacts_src
id: validate_artifacts_src
shell: bash
run: |
set -euo pipefail
echo "PWD = $(pwd)"
DW_PATH="${{ env.DW_PATH }}"
[ -z "$DW_PATH" ] && { echo "DW_PATH is null or empty whitespace!"; exit 1; }
[ ! -d "$DW_PATH" ] && { echo "DW_PATH does not exist!"; exit 1; }
pushd $DW_PATH
[ -z "$(ls -A)" ] && { echo "DW_PATH is empty! PLEASE CHECK YOUR INPUTS!!!"; exit 1; }
tree || ls -al
# echo and exit 1, if there is no *.csproj file in the directory
[ -z "$(find . -type f -name '*.csproj')" ] && { echo "No *.csproj file found in $DW_PATH!"; exit 1; }
# echo and exit 1, if there is no bin/Release/*/*.dll file in the directory
[ -z "$(find . -type f -name '*.dll' -path '*/bin/Release/*')" ] && { echo "No *.dll file found in $DW_PATH/bin/Release/*!"; exit 1; }
popd
echo "Validation of artifacts in $DW_PATH is successful! dotnet pack could be called now!"
sleep 120s
exit 1
# - name: create_release
# id: create_release
# uses: actions/create-release@v1
# with:
# tag_name: ${{ steps.iteration_vars.outputs.BRANCH_VERSION }}
# release_name: ${{ steps.iteration_vars.outputs.BRANCH_VERSION }}
# body: |
# Release candidate run ID: ${{ steps.iteration_vars.outputs.RC_RUN_ID }}
# draft: false
# prerelease: false
# token: ${{ secrets.GITHUB_TOKEN }}