Skip to content

Commit d8b70d4

Browse files
Copy released JSON to board URL, not new one (#8182)
* Copy released JSON to board URL, not new one Fixes #8180 The draft release generates a ZIP and JSON. Instead of rebuilding the ZIP on the publish step (which may result in a different SHA256 due to file time differences in the new ZIP), just copy the one from the published release directly. Also clean up and remove unneeded environment variables and CI steps. * Be more paranoid about JSON format, check after d/l
1 parent 421d02e commit d8b70d4

File tree

2 files changed

+5
-32
lines changed

2 files changed

+5
-32
lines changed

Diff for: .github/workflows/release-to-publish.yml

-20
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,6 @@ jobs:
3636
run:
3737
shell: bash
3838
steps:
39-
- uses: actions/checkout@v2
40-
with:
41-
submodules: true
42-
fetch-depth: 0
43-
- uses: actions/setup-python@v2
44-
with:
45-
python-version: '3.x'
46-
- name: Set GIT tag name
47-
run: |
48-
TRAVIS_TAG="$(git describe --exact-match --tags)"
49-
echo "TRAVIS_TAG=${TRAVIS_TAG}" >> $GITHUB_ENV
5039
- name: Deploy updated JSON
51-
env:
52-
TRAVIS_BUILD_DIR: ${{ github.workspace }}
53-
BUILD_TYPE: package
54-
CI_GITHUB_API_KEY: ${{ secrets.GITHUB_TOKEN }}
55-
GHCI_DEPLOY_KEY: ${{ secrets.GHCI_DEPLOY_KEY }}
5640
run: |
57-
bash ./tests/ci/build_package.sh
58-
# Only the regenerated JSON file will be used, but it's simpler
59-
# than looking for it in a GH release.
6041
bash ./package/deploy_package_index.sh
61-

Diff for: package/deploy_package_index.sh

+5-12
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,15 @@ cd $(dirname "$0")
1010

1111
set -e # Abort with error if anything here does not go as expected!
1212

13-
# Install SSH private key from a GH Secret
14-
echo $GHCI_DEPLOY_KEY | base64 -d > esp8266_github_io_deploy
15-
eval "$(ssh-agent -s)"
16-
chmod 600 esp8266_github_io_deploy
17-
ssh-add esp8266_github_io_deploy
18-
mkdir -p ~/.ssh
19-
chmod go-w ~/.ssh
20-
echo -e "Host github.com\nStrictHostKeyChecking no\n" >> ~/.ssh/config
21-
chmod go-w ~/.ssh/config
22-
2313
# Clone the Github pages repository
2414
git clone [email protected]:esp8266/esp8266.github.io.git
2515
pushd esp8266.github.io
2616

27-
# Update the package index
28-
cp ../versions/*/package_esp8266com_index.json stable/package_esp8266com_index.json
17+
# Copy from published release, ensure JSON valid
18+
rm -f stable/package_esp8266com_index.json
19+
wget "https://github.com/esp8266/Arduino/releases/download/$tag/package_esp8266com_index.json" -O stable/package_esp8266com_index.json
20+
cat stable/package_esp8266com_index.json | jq empty
21+
2922
git add stable/package_esp8266com_index.json
3023

3124
# Commit and push the changes

0 commit comments

Comments
 (0)