Skip to content

Commit

Permalink
first time publish, hardcode to 0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Dilan Bhalla committed Jan 31, 2025
1 parent 4e24f32 commit efe01c1
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/microsoft-codeql-pack-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,29 @@ jobs:
- name: Prepare Publish
shell: bash
run: |
# Download latest qlpack
gh codeql pack download "microsoft/$LANGUAGE-queries"
PACK_DIR="$HOME/.codeql/packages/microsoft/$LANGUAGE"
VERSION_COUNT=$(ls -d "$PACK_DIR"/*/ | wc -l)
[[ "$VERSION_COUNT" -ne 1 ]] && { echo "Expected exactly one version in $PACK_DIR, but found $VERSION_COUNT. Exiting."; exit 1; }
# # Download latest qlpack
# gh codeql pack download "microsoft/$LANGUAGE-queries"
# PACK_DIR="$HOME/.codeql/packages/microsoft/$LANGUAGE"
# VERSION_COUNT=$(ls -d "$PACK_DIR"/*/ | wc -l)
# [[ "$VERSION_COUNT" -ne 1 ]] && { echo "Expected exactly one version in $PACK_DIR, but found $VERSION_COUNT. Exiting."; exit 1; }
# Increment version
CURRENT_VERSION=$(ls -v "$PACK_DIR" | tail -n 1)
MAJOR=$(echo "$CURRENT_VERSION" | cut -d. -f1)
MINOR=$(echo "$CURRENT_VERSION" | cut -d. -f2)
PATCH=$(echo "$CURRENT_VERSION" | cut -d. -f3)
NEXT_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
# # Increment version
# CURRENT_VERSION=$(ls -v "$PACK_DIR" | tail -n 1)
# MAJOR=$(echo "$CURRENT_VERSION" | cut -d. -f1)
# MINOR=$(echo "$CURRENT_VERSION" | cut -d. -f2)
# PATCH=$(echo "$CURRENT_VERSION" | cut -d. -f3)
# NEXT_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
# Extract dependencies from the existing qlpack.yml before deleting
DEPENDENCIES=$(yq '.dependencies' "$LANGUAGE/ql/src/qlpack.yml" 2>/dev/null || echo "")
rm -f "$LANGUAGE/ql/src/qlpack.yml" "$LANGUAGE/ql/src/qlpack.lock"
# # Extract dependencies from the existing qlpack.yml before deleting
# DEPENDENCIES=$(yq '.dependencies' "$LANGUAGE/ql/src/qlpack.yml" 2>/dev/null || echo "")
# rm -f "$LANGUAGE/ql/src/qlpack.yml" "$LANGUAGE/ql/src/qlpack.lock"
FIRST_VERSION="0.0.1"
# Create new qlpack.yml with modified content
cat <<EOF > "$LANGUAGE/ql/src/qlpack.yml"
name: microsoft/$LANGUAGE-queries
version: $NEXT_VERSION
version: $FIRST_VERSION
groups:
- $LANGUAGE
- queries
Expand Down

0 comments on commit efe01c1

Please sign in to comment.