1+ name : " Prepare CodeQL Coding Standards release"
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ version :
7+ description : |
8+ The version to release (MUST follow semantic versioning).
9+ required : true
10+ ref :
11+ description : |
12+ The git commit, branch, or tag to release from.
13+ required : true
14+
15+ env :
16+ RELEASE_VERSION : ${{ github.event.inputs.version }}
17+
18+ jobs :
19+ prepare-release :
20+ runs-on : ubuntu-latest
21+ steps :
22+ - name : Checkout
23+ uses : actions/checkout@v2
24+ with :
25+ ref : ${{ github.event.inputs.ref }}
26+
27+ - name : Install Python
28+ uses : actions/setup-python@v2
29+ with :
30+ python-version : " 3.9"
31+
32+ - name : Install release script dependencies
33+ run : pip install -r scripts/release/requirements.txt
34+
35+ - name : Validate version
36+ run : |
37+ scripts/release/validate-version.py "$RELEASE_VERSION"
38+
39+ - name : Create release branch
40+ run : |
41+ git switch -c rc/$RELEASE_VERSION
42+ git push --set-upstream origin rc/$RELEASE_VERSION
43+
44+ - name : Update user manual version
45+ run : |
46+ find docs -name 'user_manual.md' | xargs sed -i "s/code-scanning-cpp-query-pack-.*\.zip\`/code-scanning-cpp-query-pack-$RELEASE_VERSION.zip\`/"
47+ find docs -name 'user_manual.md' | xargs sed -i "s/supported_rules_list_.*\.csv\`/supported_rules_list_$RELEASE_VERSION.csv\`/"
48+ find docs -name 'user_manual.md' | xargs sed -i "s/supported_rules_list_.*\.md\`/supported_rules_list_$RELEASE_VERSION.md\`/"
49+ find docs -name 'user_manual.md' | xargs sed -i "s/user_manual_.*\.md\`/user_manual_$RELEASE_VERSION.md\`/"
50+ find docs -name 'user_manual.md' | xargs sed -i "s/This user manual documents release \`.*\` of/This user manual documents release \`$RELEASE_VERSION\` of/"
51+
52+ - name : Create release PR
53+ uses : peter-evans/create-pull-request@v4
54+ with :
55+ title : " Release $RELEASE_VERSION."
56+ body : " This PR releases codeql-coding-standards version $RELEASE_VERSION."
57+ commit-message : " Release $RELEASE_VERSION."
58+ delete-branch : true
59+ branch : " rc/$RELEASE_VERSION"
60+
61+
0 commit comments