File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,18 +82,14 @@ jobs:
8282 if : steps.check.outputs.exists == 'false'
8383 run : bash scripts/build.sh
8484
85- - name : Generate SHA256 checksum
86- if : steps.check.outputs.exists == 'false'
87- run : shasum -a 256 config/profiles.json | awk '{print $1}' > dist/profiles.json.sha256
88-
8985 - name : Commit dist
9086 if : steps.check.outputs.exists == 'false'
9187 run : |
9288 VERSION="${{ steps.check.outputs.version }}"
9389 DATE="${{ steps.check.outputs.date_display }}"
9490 git config user.name "github-actions[bot]"
9591 git config user.email "github-actions[bot]@users.noreply.github.com"
96- git add dist/
92+ git add dist/ config/profiles.json config/profiles.json.sha256
9793 git commit -m "nightly: Nightly @ ${DATE} (v${VERSION})" || echo "No changes to commit"
9894
9995 - name : Tag and push
@@ -132,4 +128,4 @@ jobs:
132128 files : |
133129 dist/quickstart.sh
134130 dist/quickstart.ps1
135- dist /profiles.json.sha256
131+ config /profiles.json.sha256
Original file line number Diff line number Diff line change 7777 files : |
7878 dist/quickstart.sh
7979 dist/quickstart.ps1
80+ config/profiles.json.sha256
Original file line number Diff line number Diff line change 1+ f11eb0443b3bc103e2a649f14686578e796352bb36817555bb10e0b7d1f79ae7
Original file line number Diff line number Diff line change @@ -1027,11 +1027,7 @@ function Show-Banner {
10271027# ============================================
10281028function Test-ConfigChecksum {
10291029param ([string ]$Path , [string ]$Url )
1030- if ($Url -eq $DEFAULT_CFG_URL ) {
1031- $sha256Url = " https://github.com/MomoLawson/Quickstart-PC/releases/download/v${VERSION} /profiles.json.sha256"
1032- } else {
1033- $sha256Url = " ${Url} .sha256"
1034- }
1030+ $sha256Url = " ${Url} .sha256"
10351031 try {
10361032 $expectedHash = (Invoke-WebRequestWithProxy - Uri $sha256Url - TimeoutSec 30 - ErrorAction Stop).Content.Trim()
10371033 $actualHash = (Get-FileHash - Path $Path - Algorithm SHA256).Hash.ToLower()
Original file line number Diff line number Diff line change @@ -1626,13 +1626,7 @@ get_linux_field() {
16261626verify_config_checksum () {
16271627 local config_file=" $1 "
16281628 local config_url=" $2 "
1629- local sha256_url
1630-
1631- if [[ " $config_url " == " $DEFAULT_CFG_URL " ]]; then
1632- sha256_url=" https://github.com/MomoLawson/Quickstart-PC/releases/download/v${VERSION} /profiles.json.sha256"
1633- else
1634- sha256_url=" ${config_url} .sha256"
1635- fi
1629+ local sha256_url=" ${config_url} .sha256"
16361630
16371631 local expected_hash
16381632 local actual_hash
Original file line number Diff line number Diff line change @@ -74,6 +74,12 @@ if [[ -f "$SRC_FILE" ]]; then
7474 echo " Size: $( wc -c < " $DIST_FILE " ) bytes"
7575fi
7676
77+ # Generate SHA256 checksum for profiles.json (committed to repo, used by scripts at runtime)
78+ if [[ -f " $CONFIG_DIR /profiles.json" ]]; then
79+ shasum -a 256 " $CONFIG_DIR /profiles.json" | awk ' {print $1}' > " $CONFIG_DIR /profiles.json.sha256"
80+ echo " [✓] SHA256: $CONFIG_DIR /profiles.json.sha256"
81+ fi
82+
7783# Copy language files to dist/lang/
7884LANG_SRC=" $SRC_DIR /lang"
7985LANG_DIST=" $DIST_DIR /lang"
Original file line number Diff line number Diff line change @@ -127,23 +127,13 @@ main() {
127127 notes=$( cat " $PROJECT_DIR /changelog.md" )
128128 fi
129129
130- # Generate SHA256 checksum for profiles.json
131- echo " [→] Generating SHA256 checksum for profiles.json..."
132- local profiles_json=" $PROJECT_DIR /config/profiles.json"
133- if [[ -f " $profiles_json " ]]; then
134- shasum -a 256 " $profiles_json " | awk ' {print $1}' > " $PROJECT_DIR /dist/profiles.json.sha256"
135- echo " [✓] SHA256 checksum generated"
136- else
137- echo " [!] profiles.json not found, skipping checksum"
138- fi
139-
140130 gh release create " v$new_version " \
141131 --title " v$new_version " \
142132 --notes " $notes " \
143133 --prerelease \
144134 " $PROJECT_DIR /dist/quickstart.sh" \
145135 " $PROJECT_DIR /dist/quickstart.ps1" \
146- " $PROJECT_DIR /dist /profiles.json.sha256"
136+ " $PROJECT_DIR /config /profiles.json.sha256"
147137 echo " [✓] GitHub release created: v$new_version (pre-release)"
148138
149139 # Clear changelog after release
Original file line number Diff line number Diff line change @@ -1027,11 +1027,7 @@ function Show-Banner {
10271027# ============================================
10281028function Test-ConfigChecksum {
10291029param ([string ]$Path , [string ]$Url )
1030- if ($Url -eq $DEFAULT_CFG_URL ) {
1031- $sha256Url = " https://github.com/MomoLawson/Quickstart-PC/releases/download/v${VERSION} /profiles.json.sha256"
1032- } else {
1033- $sha256Url = " ${Url} .sha256"
1034- }
1030+ $sha256Url = " ${Url} .sha256"
10351031 try {
10361032 $expectedHash = (Invoke-WebRequestWithProxy - Uri $sha256Url - TimeoutSec 30 - ErrorAction Stop).Content.Trim()
10371033 $actualHash = (Get-FileHash - Path $Path - Algorithm SHA256).Hash.ToLower()
Original file line number Diff line number Diff line change @@ -1626,13 +1626,7 @@ get_linux_field() {
16261626verify_config_checksum () {
16271627 local config_file=" $1 "
16281628 local config_url=" $2 "
1629- local sha256_url
1630-
1631- if [[ " $config_url " == " $DEFAULT_CFG_URL " ]]; then
1632- sha256_url=" https://github.com/MomoLawson/Quickstart-PC/releases/download/v${VERSION} /profiles.json.sha256"
1633- else
1634- sha256_url=" ${config_url} .sha256"
1635- fi
1629+ local sha256_url=" ${config_url} .sha256"
16361630
16371631 local expected_hash
16381632 local actual_hash
You can’t perform that action at this time.
0 commit comments