mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-28 07:57:38 +01:00
ci: fix - version number was inconsistent across deployment of beta channels
This commit is contained in:
7
.github/workflows/alpha.yml
vendored
7
.github/workflows/alpha.yml
vendored
@@ -50,17 +50,16 @@ jobs:
|
|||||||
MARKETING_VERSION=$(python3 scripts/ci/workflow.py get-marketing-version)
|
MARKETING_VERSION=$(python3 scripts/ci/workflow.py get-marketing-version)
|
||||||
SHORT_COMMIT=$(python3 scripts/ci/workflow.py commit-id)
|
SHORT_COMMIT=$(python3 scripts/ci/workflow.py commit-id)
|
||||||
|
|
||||||
QUALIFIED_VERSION=$(python3 scripts/ci/workflow.py compute-qualified \
|
NORMALIZED_VERSION=$(python3 scripts/ci/workflow.py compute-normalized \
|
||||||
"$MARKETING_VERSION" \
|
"$MARKETING_VERSION" \
|
||||||
"$BUILD_NUM" \
|
"$BUILD_NUM" \
|
||||||
"${{ env.CHANNEL }}" \
|
|
||||||
"$SHORT_COMMIT")
|
"$SHORT_COMMIT")
|
||||||
|
|
||||||
python3 scripts/ci/workflow.py set-marketing-version "$QUALIFIED_VERSION"
|
python3 scripts/ci/workflow.py set-marketing-version "$NORMALIZED_VERSION"
|
||||||
|
|
||||||
echo "BUILD_NUM=$BUILD_NUM" | tee -a $GITHUB_ENV
|
echo "BUILD_NUM=$BUILD_NUM" | tee -a $GITHUB_ENV
|
||||||
echo "SHORT_COMMIT=$SHORT_COMMIT" | tee -a $GITHUB_ENV
|
echo "SHORT_COMMIT=$SHORT_COMMIT" | tee -a $GITHUB_ENV
|
||||||
echo "MARKETING_VERSION=$QUALIFIED_VERSION" | tee -a $GITHUB_ENV
|
echo "MARKETING_VERSION=$NORMALIZED_VERSION" | tee -a $GITHUB_ENV
|
||||||
|
|
||||||
- name: Setup Xcode
|
- name: Setup Xcode
|
||||||
uses: maxim-lobanov/setup-xcode@v1.6.0
|
uses: maxim-lobanov/setup-xcode@v1.6.0
|
||||||
|
|||||||
7
.github/workflows/nightly.yml
vendored
7
.github/workflows/nightly.yml
vendored
@@ -74,17 +74,16 @@ jobs:
|
|||||||
MARKETING_VERSION=$(python3 scripts/ci/workflow.py get-marketing-version)
|
MARKETING_VERSION=$(python3 scripts/ci/workflow.py get-marketing-version)
|
||||||
SHORT_COMMIT=$(python3 scripts/ci/workflow.py commit-id)
|
SHORT_COMMIT=$(python3 scripts/ci/workflow.py commit-id)
|
||||||
|
|
||||||
QUALIFIED_VERSION=$(python3 scripts/ci/workflow.py compute-qualified \
|
NORMALIZED_VERSION=$(python3 scripts/ci/workflow.py compute-normalized \
|
||||||
"$MARKETING_VERSION" \
|
"$MARKETING_VERSION" \
|
||||||
"$BUILD_NUM" \
|
"$BUILD_NUM" \
|
||||||
"${{ env.CHANNEL }}" \
|
|
||||||
"$SHORT_COMMIT")
|
"$SHORT_COMMIT")
|
||||||
|
|
||||||
python3 scripts/ci/workflow.py set-marketing-version "$QUALIFIED_VERSION"
|
python3 scripts/ci/workflow.py set-marketing-version "$NORMALIZED_VERSION"
|
||||||
|
|
||||||
echo "BUILD_NUM=$BUILD_NUM" | tee -a $GITHUB_ENV
|
echo "BUILD_NUM=$BUILD_NUM" | tee -a $GITHUB_ENV
|
||||||
echo "SHORT_COMMIT=$SHORT_COMMIT" | tee -a $GITHUB_ENV
|
echo "SHORT_COMMIT=$SHORT_COMMIT" | tee -a $GITHUB_ENV
|
||||||
echo "MARKETING_VERSION=$QUALIFIED_VERSION" | tee -a $GITHUB_ENV
|
echo "MARKETING_VERSION=$NORMALIZED_VERSION" | tee -a $GITHUB_ENV
|
||||||
|
|
||||||
- name: Setup Xcode
|
- name: Setup Xcode
|
||||||
if: steps.build_gate.outputs.should_skip != 'true'
|
if: steps.build_gate.outputs.should_skip != 'true'
|
||||||
|
|||||||
6
.github/workflows/pr.yml
vendored
6
.github/workflows/pr.yml
vendored
@@ -27,10 +27,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
MARKETING_VERSION=$(python3 scripts/ci/workflow.py get-marketing-version)
|
MARKETING_VERSION=$(python3 scripts/ci/workflow.py get-marketing-version)
|
||||||
SHORT_COMMIT=$(git rev-parse --short ${{ github.event.pull_request.head.sha }})
|
SHORT_COMMIT=$(git rev-parse --short ${{ github.event.pull_request.head.sha }})
|
||||||
QUALIFIED_VERSION="${MARKETING_VERSION}-pr.${{ github.event.pull_request.number }}+${SHORT_COMMIT}"
|
NORMALIZED_VERSION="${MARKETING_VERSION}-pr.${{ github.event.pull_request.number }}+${SHORT_COMMIT}"
|
||||||
python3 scripts/ci/workflow.py set-marketing-version "$QUALIFIED_VERSION"
|
python3 scripts/ci/workflow.py set-marketing-version "$NORMALIZED_VERSION"
|
||||||
echo "SHORT_COMMIT=$SHORT_COMMIT" | tee -a $GITHUB_ENV
|
echo "SHORT_COMMIT=$SHORT_COMMIT" | tee -a $GITHUB_ENV
|
||||||
echo "MARKETING_VERSION=$QUALIFIED_VERSION" | tee -a $GITHUB_ENV
|
echo "MARKETING_VERSION=$NORMALIZED_VERSION" | tee -a $GITHUB_ENV
|
||||||
|
|
||||||
- name: Setup Xcode
|
- name: Setup Xcode
|
||||||
uses: maxim-lobanov/setup-xcode@v1.6.0
|
uses: maxim-lobanov/setup-xcode@v1.6.0
|
||||||
|
|||||||
@@ -181,9 +181,12 @@ def set_marketing_version(qualified):
|
|||||||
f"{ROOT}/Build.xcconfig"
|
f"{ROOT}/Build.xcconfig"
|
||||||
)
|
)
|
||||||
|
|
||||||
def compute_qualified_version(marketing, build_num, channel, short):
|
|
||||||
date = datetime.datetime.now(datetime.UTC).strftime("%Y.%m.%d")
|
def compute_qualified_version(marketing, build_num, short):
|
||||||
return f"{marketing}-{channel}.{date}.{build_num}+{short}"
|
now = datetime.datetime.now(datetime.UTC)
|
||||||
|
date = now.strftime("%Y%m%d") # normalized date
|
||||||
|
base = marketing.strip()
|
||||||
|
return f"{base}-{date}.{build_num}+{short}"
|
||||||
|
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
# CLEAN
|
# CLEAN
|
||||||
@@ -420,7 +423,6 @@ def upload_release(release_name, release_tag, commit_sha, repo, upstream_tag_rec
|
|||||||
meta = json.loads(metadata_path.read_text())
|
meta = json.loads(metadata_path.read_text())
|
||||||
|
|
||||||
marketing_version = meta.get("version_ipa")
|
marketing_version = meta.get("version_ipa")
|
||||||
is_beta = bool(meta.get("is_beta"))
|
|
||||||
build_datetime = meta.get("version_date")
|
build_datetime = meta.get("version_date")
|
||||||
|
|
||||||
dt = datetime.datetime.fromisoformat(
|
dt = datetime.datetime.fromisoformat(
|
||||||
@@ -461,8 +463,6 @@ def upload_release(release_name, release_tag, commit_sha, repo, upstream_tag_rec
|
|||||||
body_file = ROOT / "release_body.md"
|
body_file = ROOT / "release_body.md"
|
||||||
body_file.write_text(body, encoding="utf-8")
|
body_file.write_text(body, encoding="utf-8")
|
||||||
|
|
||||||
prerelease_flag = "--prerelease" if is_beta else ""
|
|
||||||
|
|
||||||
draft_flag = "--draft" if draft else ""
|
draft_flag = "--draft" if draft else ""
|
||||||
prerelease_flag = "--prerelease" if prerelease else ""
|
prerelease_flag = "--prerelease" if prerelease else ""
|
||||||
latest_flag = "" if update_tag else "--latest=false"
|
latest_flag = "" if update_tag else "--latest=false"
|
||||||
@@ -517,7 +517,7 @@ COMMANDS = {
|
|||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
"get-marketing-version" : (get_marketing_version, 0, ""),
|
"get-marketing-version" : (get_marketing_version, 0, ""),
|
||||||
"set-marketing-version" : (set_marketing_version, 1, "<qualified_version>"),
|
"set-marketing-version" : (set_marketing_version, 1, "<qualified_version>"),
|
||||||
"compute-qualified" : (compute_qualified_version, 4, "<marketing> <build_num> <channel> <short_commit>"),
|
"compute-qualified" : (compute_qualified_version, 3, "<marketing> <build_num> <short_commit>"),
|
||||||
"reserve_build_number" : (reserve_build_number, 1, "<repo>"),
|
"reserve_build_number" : (reserve_build_number, 1, "<repo>"),
|
||||||
"get-product-name" : (get_product_name, 0, ""),
|
"get-product-name" : (get_product_name, 0, ""),
|
||||||
"get-bundle-id" : (get_bundle_id, 0, ""),
|
"get-bundle-id" : (get_bundle_id, 0, ""),
|
||||||
|
|||||||
Reference in New Issue
Block a user