Save vars in tmp

This commit is contained in:
Antoine Martin 2024-10-10 15:31:14 -04:00
parent fb3cb6a75f
commit af8c2c766f
Signed by: forge
GPG key ID: D62A472A4AA7D541

View file

@ -33,25 +33,25 @@ jobs:
else else
CI_REF_NAME=$GITHUB_REF_NAME CI_REF_NAME=$GITHUB_REF_NAME
fi fi
echo $CI_REF_NAME > ci_ref_name echo $CI_REF_NAME > /tmp/ci_ref_name
curl --silent https://raw.githubusercontent.com/electron/electron/$CI_REF_NAME/.github/actions/install-build-tools/action.yml | grep BUILD_TOOLS_SHA | awk -F "=" '{print $2}' > /tmp/depottoolsver curl --silent https://raw.githubusercontent.com/electron/electron/$CI_REF_NAME/.github/actions/install-build-tools/action.yml | grep BUILD_TOOLS_SHA | awk -F "=" '{print $2}' > /tmp/depottoolsver
curl --silent https://raw.githubusercontent.com/electron/electron/$CI_REF_NAME/DEPS | grep "'chromium_version':" -A 1 | tail -n 1 | tr -d "'" | tr -d ',' | tr -d ' ' > /tmp/chromiumver curl --silent https://raw.githubusercontent.com/electron/electron/$CI_REF_NAME/DEPS | grep "'chromium_version':" -A 1 | tail -n 1 | tr -d "'" | tr -d ',' | tr -d ' ' > /tmp/chromiumver
- name: Getting depot_tools - name: Getting depot_tools
run: | run: |
read _depottoolsver < depottoolsver read _depottoolsver < /tmp/depottoolsver
git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git ./ git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git ./
git fetch --depth 1 origin $_depottoolsver git fetch --depth 1 origin $_depottoolsver
git checkout $_depottoolsver git checkout $_depottoolsver
- name: Fetching electron - name: Fetching electron
run: | run: |
read CI_REF_NAME < ci_ref_name read CI_REF_NAME < /tmp/ci_ref_name
read _chromiumver < chromiumver read _chromiumver < /tmp/chromiumver
echo "solutions = [{'name': 'src/electron','url': 'https://github.com/electron/electron.git@$CI_REF_NAME','deps_file': 'DEPS','managed': False,'custom_deps': {'src': 'https://chromium.googlesource.com/chromium/src.git@$_chromiumver',},'custom_vars': {},},]' > .gclient echo "solutions = [{'name': 'src/electron','url': 'https://github.com/electron/electron.git@$CI_REF_NAME','deps_file': 'DEPS','managed': False,'custom_deps': {'src': 'https://chromium.googlesource.com/chromium/src.git@$_chromiumver',},'custom_vars': {},},]' > .gclient
./gclient sync --no-history --nohooks ./gclient sync --no-history --nohooks
- name: Preparing source - name: Preparing source
run: | run: |
read _chromiumver < chromiumver read _chromiumver < /tmp/chromiumver
read CI_REF_NAME < ci_ref_name read CI_REF_NAME < /tmp/ci_ref_name
python3 src/build/landmines.py python3 src/build/landmines.py
python3 src/build/util/lastchange.py -o src/build/util/LASTCHANGE python3 src/build/util/lastchange.py -o src/build/util/LASTCHANGE
python3 src/build/util/lastchange.py -s src/third_party/dawn --revision src/gpu/webgpu/DAWN_VERSION python3 src/build/util/lastchange.py -s src/third_party/dawn --revision src/gpu/webgpu/DAWN_VERSION
@ -69,20 +69,20 @@ jobs:
mv src electron-$CI_REF_NAME-$_chromiumver mv src electron-$CI_REF_NAME-$_chromiumver
- name: Packaging source - name: Packaging source
run: | run: |
read CI_REF_NAME < ci_ref_name read CI_REF_NAME < /tmp/ci_ref_name
read _chromiumver < chromiumver read _chromiumver < /tmp/chromiumver
tar -cf $pkgname-$_semver-$_chromium.tar --exclude="ChangeLog*" --exclude="testdata/*" --exclude="test_data/*" --exclude="android_rust_toolchain/*" --exclude-backups --exclude-caches-all --exclude-vcs electron-$CI_REF_NAME-$_chromiumver tar -cf $pkgname-$_semver-$_chromium.tar --exclude="ChangeLog*" --exclude="testdata/*" --exclude="test_data/*" --exclude="android_rust_toolchain/*" --exclude-backups --exclude-caches-all --exclude-vcs electron-$CI_REF_NAME-$_chromiumver
zstd --auto-threads=logical --ultra --long -22 -T"${ZSTD_LIMIT:-0}" -vv electron-$CI_REF_NAME-$_chromiumver.tar -o electron-$CI_REF_NAME-$_chromiumver.tar.zst zstd --auto-threads=logical --ultra --long -22 -T"${ZSTD_LIMIT:-0}" -vv electron-$CI_REF_NAME-$_chromiumver.tar -o electron-$CI_REF_NAME-$_chromiumver.tar.zst
- name: Computing checksums - name: Computing checksums
run: | run: |
read CI_REF_NAME < ci_ref_name read CI_REF_NAME < /tmp/ci_ref_name
read _chromiumver < chromiumver read _chromiumver < /tmp/chromiumver
sha512sum electron-$CI_REF_NAME-$_chromiumver.tar.zst > electron-$CI_REF_NAME-$_chromiumver.tar.zst.sha512sum sha512sum electron-$CI_REF_NAME-$_chromiumver.tar.zst > electron-$CI_REF_NAME-$_chromiumver.tar.zst.sha512sum
- name: Package deployment - name: Package deployment
run: | run: |
read CI_REF_NAME < ci_ref_name read CI_REF_NAME < /tmp/ci_ref_name
read _chromiumver < chromiumver read _chromiumver < /tmp/chromiumver
echo "Sending to ${{ github.server_url }}/api/packages/mirrors/generic/electron/$CI_REF_NAME/electron-$CI_REF_NAME-$_chromiumver.tar.zst" echo "Sending to ${{ github.server_url }}/api/packages/mirrors/generic/electron/$CI_REF_NAME/electron-$CI_REF_NAME-$_chromiumver.tar.zst"
curl --user ${{ vars.CODE_FORGEJO_USER }}:${{ secrets.CODE_FORGEJO_TOKEN }} --upload-file electron-*.tar.zst ${{ github.server_url }}/api/packages/mirrors/generic/electron/$CI_REF_NAME/electron-$CI_REF_NAME-$_chromiumver.tar.zst curl --user ${{ vars.CODE_FORGEJO_USER }}:${{ secrets.CODE_FORGEJO_TOKEN }} --upload-file electron-*.tar.zst ${{ github.server_url }}/api/packages/mirrors/generic/electron/$CI_REF_NAME/electron-$CI_REF_NAME-$_chromiumver.tar.zst
curl --user ${{ vars.CODE_FORGEJO_USER }}:${{ secrets.CODE_FORGEJO_TOKEN }} --upload-file electron-*.tar.zst.sha512sum ${{ github.server_url }}/api/packages/mirrors/generic/electron/$CI_REF_NAME/electron-$CI_REF_NAME-$_chromiumver.zst.sha512sum curl --user ${{ vars.CODE_FORGEJO_USER }}:${{ secrets.CODE_FORGEJO_TOKEN }} --upload-file electron-*.tar.zst.sha512sum ${{ github.server_url }}/api/packages/mirrors/generic/electron/$CI_REF_NAME/electron-$CI_REF_NAME-$_chromiumver.zst.sha512sum