mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-17 05:26:56 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae8a961e93 | ||
|
|
e4b5ea3895 | ||
|
|
b61f479180 |
2
.github/workflows/Parameters.yml
vendored
2
.github/workflows/Parameters.yml
vendored
@@ -260,7 +260,7 @@ jobs:
|
|||||||
|
|
||||||
currentMSYS2Version = "3.12"
|
currentMSYS2Version = "3.12"
|
||||||
currentAlphaVersion = "3.14"
|
currentAlphaVersion = "3.14"
|
||||||
currentAlphaRelease = "3.14.0-rc.2"
|
currentAlphaRelease = "3.14.0-rc.3"
|
||||||
|
|
||||||
if systems == "":
|
if systems == "":
|
||||||
print("::error title=Parameter::system_list is empty.")
|
print("::error title=Parameter::system_list is empty.")
|
||||||
|
|||||||
74
.github/workflows/PrepareJob.yml
vendored
74
.github/workflows/PrepareJob.yml
vendored
@@ -35,15 +35,18 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
|
on_default_branch:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Prepare.outputs.on_default_branch }}
|
||||||
on_main_branch:
|
on_main_branch:
|
||||||
description: ""
|
description: ""
|
||||||
value: ${{ jobs.Prepare.outputs.on_main_branch }}
|
value: ${{ jobs.Prepare.outputs.on_main_branch }}
|
||||||
on_dev_branch:
|
|
||||||
description: ""
|
|
||||||
value: ${{ jobs.Prepare.outputs.on_dev_branch }}
|
|
||||||
on_release_branch:
|
on_release_branch:
|
||||||
description: ""
|
description: ""
|
||||||
value: ${{ jobs.Prepare.outputs.on_release_branch }}
|
value: ${{ jobs.Prepare.outputs.on_release_branch }}
|
||||||
|
on_dev_branch:
|
||||||
|
description: ""
|
||||||
|
value: ${{ jobs.Prepare.outputs.on_dev_branch }}
|
||||||
is_regular_commit:
|
is_regular_commit:
|
||||||
description: ""
|
description: ""
|
||||||
value: ${{ jobs.Prepare.outputs.is_regular_commit }}
|
value: ${{ jobs.Prepare.outputs.is_regular_commit }}
|
||||||
@@ -89,9 +92,10 @@ jobs:
|
|||||||
name: Extract Information
|
name: Extract Information
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
outputs:
|
outputs:
|
||||||
|
on_default_branch: ${{ steps.Classify.outputs.on_default_branch }}
|
||||||
on_main_branch: ${{ steps.Classify.outputs.on_main_branch }}
|
on_main_branch: ${{ steps.Classify.outputs.on_main_branch }}
|
||||||
on_dev_branch: ${{ steps.Classify.outputs.on_dev_branch }}
|
|
||||||
on_release_branch: ${{ steps.Classify.outputs.on_release_branch }}
|
on_release_branch: ${{ steps.Classify.outputs.on_release_branch }}
|
||||||
|
on_dev_branch: ${{ steps.Classify.outputs.on_dev_branch }}
|
||||||
is_regular_commit: ${{ steps.Classify.outputs.is_regular_commit }}
|
is_regular_commit: ${{ steps.Classify.outputs.is_regular_commit }}
|
||||||
is_merge_commit: ${{ steps.Classify.outputs.is_merge_commit }}
|
is_merge_commit: ${{ steps.Classify.outputs.is_merge_commit }}
|
||||||
is_release_commit: ${{ steps.Classify.outputs.is_release_commit }}
|
is_release_commit: ${{ steps.Classify.outputs.is_release_commit }}
|
||||||
@@ -133,15 +137,17 @@ jobs:
|
|||||||
ANSI_NOCOLOR=$'\x1b[0m'
|
ANSI_NOCOLOR=$'\x1b[0m'
|
||||||
|
|
||||||
ref="${{ github.ref }}"
|
ref="${{ github.ref }}"
|
||||||
|
on_default_branch="false"
|
||||||
on_main_branch="false"
|
on_main_branch="false"
|
||||||
on_dev_branch="false"
|
|
||||||
on_release_branch="false"
|
on_release_branch="false"
|
||||||
|
on_dev_branch="false"
|
||||||
is_regular_commit="false"
|
is_regular_commit="false"
|
||||||
is_merge_commit="false"
|
is_merge_commit="false"
|
||||||
is_release_commit="false"
|
is_release_commit="false"
|
||||||
is_nightly_tag="false"
|
is_nightly_tag="false"
|
||||||
is_release_tag="false"
|
is_release_tag="false"
|
||||||
ref_kind="unknown"
|
ref_kind="unknown"
|
||||||
|
default_branch=""
|
||||||
branch=""
|
branch=""
|
||||||
tag=""
|
tag=""
|
||||||
pr_number=""
|
pr_number=""
|
||||||
@@ -151,8 +157,29 @@ jobs:
|
|||||||
ref_kind="branch"
|
ref_kind="branch"
|
||||||
branch="${ref:11}"
|
branch="${ref:11}"
|
||||||
|
|
||||||
|
printf "Get default branch name ... "
|
||||||
|
defaultBranch=$(gh repo view "${{ github.repository }}" --json defaultBranchRef --jq '.defaultBranchRef.name')
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
printf " ${ANSI_LIGHT_GREEN} [OK]\n"
|
||||||
|
else
|
||||||
|
printf " ${ANSI_LIGHT_RED} [FAILED]\n"
|
||||||
|
fi
|
||||||
|
|
||||||
printf "Commit check:\n"
|
printf "Commit check:\n"
|
||||||
|
|
||||||
|
if [[ "${branch}" == "${defaultBranch}" ]]; then
|
||||||
|
on_default_branch="true"
|
||||||
|
|
||||||
|
if [[ -z "$(git rev-list -1 --merges ${{ github.sha }}~1..${{ github.sha }})" ]]; then
|
||||||
|
is_regular_commit="true"
|
||||||
|
printf " ${ANSI_LIGHT_YELLOW}regular "
|
||||||
|
else
|
||||||
|
is_merge_commit="true"
|
||||||
|
printf " ${ANSI_LIGHT_GREEN}merge "
|
||||||
|
fi
|
||||||
|
printf "commit${ANSI_NOCOLOR} on default branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${defaultBranch}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${branch}" == "${{ inputs.main_branch }}" ]]; then
|
if [[ "${branch}" == "${{ inputs.main_branch }}" ]]; then
|
||||||
on_main_branch="true"
|
on_main_branch="true"
|
||||||
|
|
||||||
@@ -166,19 +193,6 @@ jobs:
|
|||||||
printf "commit${ANSI_NOCOLOR} on main branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.main_branch }}"
|
printf "commit${ANSI_NOCOLOR} on main branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.main_branch }}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${branch}" == "${{ inputs.development_branch }}" ]]; then
|
|
||||||
on_dev_branch="true"
|
|
||||||
|
|
||||||
if [[ -z "$(git rev-list -1 --merges ${{ github.sha }}~1..${{ github.sha }})" ]]; then
|
|
||||||
is_regular_commit="true"
|
|
||||||
printf " ${ANSI_LIGHT_YELLOW}regular "
|
|
||||||
else
|
|
||||||
is_merge_commit="true"
|
|
||||||
printf " ${ANSI_LIGHT_GREEN}merge "
|
|
||||||
fi
|
|
||||||
printf "commit${ANSI_NOCOLOR} on development branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.development_branch }}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${branch}" == "${{ inputs.release_branch }}" ]]; then
|
if [[ "${branch}" == "${{ inputs.release_branch }}" ]]; then
|
||||||
on_release_branch="true"
|
on_release_branch="true"
|
||||||
|
|
||||||
@@ -191,20 +205,33 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
printf "commit${ANSI_NOCOLOR} on release branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.release_branch }}"
|
printf "commit${ANSI_NOCOLOR} on release branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.release_branch }}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${branch}" == "${{ inputs.development_branch }}" ]]; then
|
||||||
|
on_dev_branch="true"
|
||||||
|
|
||||||
|
if [[ -z "$(git rev-list -1 --merges ${{ github.sha }}~1..${{ github.sha }})" ]]; then
|
||||||
|
is_regular_commit="true"
|
||||||
|
printf " ${ANSI_LIGHT_YELLOW}regular "
|
||||||
|
else
|
||||||
|
is_merge_commit="true"
|
||||||
|
printf " ${ANSI_LIGHT_GREEN}merge "
|
||||||
|
fi
|
||||||
|
printf "commit${ANSI_NOCOLOR} on development branch ${ANSI_LIGHT_BLUE}'%s'${ANSI_NOCOLOR}\n" "${{ inputs.development_branch }}"
|
||||||
|
fi
|
||||||
elif [[ "${ref:0:10}" == "refs/tags/" ]]; then
|
elif [[ "${ref:0:10}" == "refs/tags/" ]]; then
|
||||||
ref_kind="tag"
|
ref_kind="tag"
|
||||||
tag="${ref:10}"
|
tag="${ref:10}"
|
||||||
|
|
||||||
printf "Tag check:\n"
|
printf "Tag check:\n"
|
||||||
|
|
||||||
printf " Check if tag is on release branch '%s' ... " "${{ inputs.release_branch }}"
|
printf " Check if tag is on main branch '%s' ... " "${{ inputs.main_branch }}"
|
||||||
git branch --remotes --contains $(git rev-parse --verify "tags/${tag}~0") | grep "origin/${{ inputs.release_branch }}" > /dev/null
|
git branch --remotes --contains $(git rev-parse --verify "tags/${tag}~0") | grep "origin/${{ inputs.main_branch }}" > /dev/null
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
printf "${ANSI_LIGHT_GREEN}[OK]${ANSI_NOCOLOR}\n"
|
||||||
else
|
else
|
||||||
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
|
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
|
||||||
printf "${ANSI_LIGHT_RED}Tag '%s' isn't on branch '%s'.${ANSI_NOCOLOR}\n" "${tag}" "${{ inputs.release_branch }}"
|
printf "${ANSI_LIGHT_RED}Tag '%s' isn't on branch '%s'.${ANSI_NOCOLOR}\n" "${tag}" "${{ inputs.main_branch }}"
|
||||||
printf "::error title=TagCheck::Tag '%s' isn't on branch '%s'.\n" "${tag}" "${{ inputs.release_branch }}"
|
printf "::error title=TagCheck::Tag '%s' isn't on branch '%s'.\n" "${tag}" "${{ inputs.main_branch }}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -240,9 +267,10 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
tee --append "${GITHUB_OUTPUT}" <<EOF
|
tee --append "${GITHUB_OUTPUT}" <<EOF
|
||||||
|
on_default_branch=${on_default_branch}
|
||||||
on_main_branch=${on_main_branch}
|
on_main_branch=${on_main_branch}
|
||||||
on_dev_branch=${on_dev_branch}
|
|
||||||
on_release_branch=${on_release_branch}
|
on_release_branch=${on_release_branch}
|
||||||
|
on_dev_branch=${on_dev_branch}
|
||||||
is_regular_commit=${is_regular_commit}
|
is_regular_commit=${is_regular_commit}
|
||||||
is_merge_commit=${is_merge_commit}
|
is_merge_commit=${is_merge_commit}
|
||||||
is_release_commit=${is_release_commit}
|
is_release_commit=${is_release_commit}
|
||||||
|
|||||||
11
.github/workflows/PublishReleaseNotes.yml
vendored
11
.github/workflows/PublishReleaseNotes.yml
vendored
@@ -496,14 +496,14 @@ jobs:
|
|||||||
|
|
||||||
# Create JSON inventory
|
# Create JSON inventory
|
||||||
if [[ "${{ inputs.inventory-json }}" != "" ]]; then
|
if [[ "${{ inputs.inventory-json }}" != "" ]]; then
|
||||||
VERSION="1.0"
|
STRUCT_VERSION="1.1"
|
||||||
|
|
||||||
# Use GitHub API to ask for latest version
|
# Use GitHub API to ask for latest version
|
||||||
printf "Get latest released version via GitHub API ...\n"
|
printf "Get latest released version via GitHub API ...\n"
|
||||||
printf " gh release list --json tagName,isLatest --jq '.[] | select(.isLatest == true) | .tagName' "
|
printf " gh release list --json tagName,isLatest --jq '.[] | select(.isLatest == true) | .tagName' "
|
||||||
latestVersion=$(gh release list --json tagName,isLatest --jq '.[] | select(.isLatest == true) | .tagName')
|
latestVersion=$(gh release list --json tagName,isLatest --jq '.[] | select(.isLatest == true) | .tagName')
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
if [[ -n "${latestVersion}" ]]; then
|
if [[ -z "${latestVersion}" ]]; then
|
||||||
printf "${ANSI_LIGHT_RED}[UNKNOWN]${ANSI_NOCOLOR}\n"
|
printf "${ANSI_LIGHT_RED}[UNKNOWN]${ANSI_NOCOLOR}\n"
|
||||||
latestVersion="unknown"
|
latestVersion="unknown"
|
||||||
else
|
else
|
||||||
@@ -528,7 +528,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
jsonInventory=$(jq -c -n \
|
jsonInventory=$(jq -c -n \
|
||||||
--arg version "${VERSION}" \
|
--arg structVersion "${STRUCT_VERSION}" \
|
||||||
--arg date "$(date +"%Y-%m-%dT%H-%M-%S%:z")" \
|
--arg date "$(date +"%Y-%m-%dT%H-%M-%S%:z")" \
|
||||||
--argjson jsonMeta "$(jq -c -n \
|
--argjson jsonMeta "$(jq -c -n \
|
||||||
--arg tag "${{ inputs.tag }}" \
|
--arg tag "${{ inputs.tag }}" \
|
||||||
@@ -538,7 +538,8 @@ jobs:
|
|||||||
--arg release "${{ github.server_url }}/${{ github.repository }}/releases/download/${{ inputs.tag }}" \
|
--arg release "${{ github.server_url }}/${{ github.repository }}/releases/download/${{ inputs.tag }}" \
|
||||||
--argjson jsonLatest "$(jq -c -n \
|
--argjson jsonLatest "$(jq -c -n \
|
||||||
--arg version "${latestVersion}" \
|
--arg version "${latestVersion}" \
|
||||||
'{"version": $version}' \
|
--arg release "${{ github.server_url }}/${{ github.repository }}/releases/download/${latestVersion}" \
|
||||||
|
'{"version": $version, "release-url": $release}' \
|
||||||
)" \
|
)" \
|
||||||
--argjson categories "$(jq -c -n \
|
--argjson categories "$(jq -c -n \
|
||||||
'$ARGS.positional' \
|
'$ARGS.positional' \
|
||||||
@@ -546,7 +547,7 @@ jobs:
|
|||||||
)" \
|
)" \
|
||||||
'{"tag": $tag, "version": $version, "git-hash": $hash, "repository-url": $repo, "release-url": $release, "categories": $categories, "latest": $jsonLatest}' \
|
'{"tag": $tag, "version": $version, "git-hash": $hash, "repository-url": $repo, "release-url": $release, "categories": $categories, "latest": $jsonLatest}' \
|
||||||
)" \
|
)" \
|
||||||
'{"version": 1.0, "timestamp": $date, "meta": $jsonMeta, "files": {}}'
|
'{"version": $structVersion, "timestamp": $date, "meta": $jsonMeta, "files": {}}'
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user