Skip to content

release for 12960204496 #15

release for 12960204496

release for 12960204496 #15

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!"
- name: dotnet_pack
id: dotnet_pack
shell: bash
run: |
set -euo pipefail
echo "PWD = $(pwd)"
OUTPUT_DIR="./.nuget"
rm -rf $OUTPUT_DIR
mkdir -p $OUTPUT_DIR
OUTPUT_DIR=$(realpath $OUTPUT_DIR)
echo "OUTPUT_DIR=$OUTPUT_DIR" >> $GITHUB_ENV
echo "OUTPUT_DIR=$OUTPUT_DIR"
PACKAGE_VERSION="${{ steps.common.outputs.branch-version }}"
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
echo "PACKAGE_VERSION=$PACKAGE_VERSION"
dotnet pack \
-c Release \
--verbosity minimal \
--no-build \
--no-restore \
-p:PackageVersion="$PACKAGE_VERSION" \
--output $OUTPUT_DIR
echo -e "\n\nls for $OUTPUT_DIR\n"
ls -al $OUTPUT_DIR
working-directory: ${{ env.DW_PATH }}
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
${{ env.OUTPUT_DIR }}/*.nupkg
${{ env.OUTPUT_DIR }}/*.snupkg
token: ${{ secrets.GH_TOKEN }}
name: v${{ steps.common.outputs.branch-version }}
tag_name: v${{ steps.common.outputs.branch-version }}
draft: false
prerelease: false
generate_release_notes: true