ci: use scripts in more places in CI (#1906)

* move cirrus release script

* update a few other places
This commit is contained in:
Clement Tsang
2025-12-20 18:53:36 -05:00
committed by GitHub
parent 469947a61e
commit 8629468e45
11 changed files with 49 additions and 42 deletions
+10 -4
View File
@@ -5,6 +5,8 @@
# - MSI installer for Windows (.msi)
# - .deb releases
# - .rpm releases
#
# TODO: Break this up into scripts instead.
name: "build releases"
@@ -79,7 +81,11 @@ jobs:
}
# macOS (x86-64 and aarch64)
- { os: "macos-15-intel", target: "x86_64-apple-darwin", cross: false }
- {
os: "macos-15-intel",
target: "x86_64-apple-darwin",
cross: false,
}
- { os: "macos-15", target: "aarch64-apple-darwin", cross: false }
# Windows (x86-64, x86)
@@ -322,12 +328,12 @@ jobs:
- {
os: "windows-2022",
target: "x86_64-pc-windows-msvc",
output: "bottom_x86_64_installer.msi"
output: "bottom_x86_64_installer.msi",
}
- {
os: "windows-11-arm",
target: "aarch64-pc-windows-msvc",
output: "bottom_aarch64_installer.msi"
output: "bottom_aarch64_installer.msi",
}
runs-on: ${{ matrix.info.os }}
steps:
@@ -416,7 +422,7 @@ jobs:
raw=$(git branch -r --contains '${{ github.ref_name }}');
BRANCH=${raw##*/};
fi
python ./scripts/cirrus/release.py "$BRANCH" "release/" "${{ inputs.caller }}"
python ./scripts/ci/cirrus_release.py "$BRANCH" "release/" "${{ inputs.caller }}"
- name: Generate artifact attestation for file
uses: actions/attest-build-provenance@6149ea5740be74af77f260b9db67e633f6b0a9a1 # v1.4.2
-8
View File
@@ -6,14 +6,6 @@
# - https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/ci.yml
# - https://www.reillywood.com/blog/rust-faster-ci/
# - https://matklad.github.io/2021/09/04/fast-rust-builds.html
#
# Supported platforms run the following tasks:
# - Format
# - Test (built/test in separate steps)
# - Clippy (apparently faster to do it after the build/test)
#
# Unsupported platforms run the following tasks:
# - Clippy
name: ci
+1 -3
View File
@@ -74,12 +74,10 @@ jobs:
cargo install cargo-llvm-cov --version 0.6.11 --locked
- name: Generate code coverage
run: |
cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info --locked --target=${{ matrix.info.target }}
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info --locked --target=${{ matrix.info.target }}
# The token is generally not needed, but sometimes the default shared token hits limits.
# Yes this is ugly as hell. Why this is not a built-in feature of GHA, I have no idea.
- name: Upload to codecov.io (Attempt 1)
id: upload_attempt_1
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
+2 -5
View File
@@ -75,14 +75,11 @@ jobs:
merge-multiple: true
- name: Execute choco packaging script
run: |
python "./scripts/windows/choco/choco_packager.py" "./release/bottom_x86_64-pc-windows-msvc.zip" ${{ env.RELEASE_VERSION }} "./scripts/windows/choco/bottom.nuspec.template" "./scripts/windows/choco/chocolateyinstall.ps1.template" "bottom.nuspec" "tools/chocolateyinstall.ps1" "tools/"
zip -r choco.zip "bottom.nuspec" "tools"
run: ./scripts/ci/generate_choco.sh
- name: Move release file into release directory
shell: bash
run: |
mv choco.zip release/
run: mv choco.zip release/
- name: Save release as artifact
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
+1 -5
View File
@@ -34,11 +34,7 @@ jobs:
run: pip install -r docs/requirements.txt
- name: Configure git user and email
run: |
git config --global user.name ${GIT_USER}
git config --global user.email ${GIT_EMAIL}
echo Name: $(git config --get user.name)
echo Email: $(git config --get user.email)
run: ./scripts/ci/configure_git.sh
- name: Build and deploy docs with mike
run: |
+4 -17
View File
@@ -67,20 +67,10 @@ jobs:
run: pip install -r docs/requirements.txt
- name: Configure git user and email
run: |
git config --global user.name ${GIT_USER}
git config --global user.email ${GIT_EMAIL}
echo Name: $(git config --get user.name)
echo Email: $(git config --get user.email)
run: ./scripts/ci/configure_git.sh
- name: Build and deploy docs with mike as the latest stable branch
run: |
cd docs
OLD_STABLE_VERSION=$(mike list stable | grep -Po '([0-9]+.[0-9]+.[0-9]+)' | head -n1)
echo ${OLD_STABLE_VERSION}
mike retitle --push stable ${OLD_STABLE_VERSION}
mike deploy --push --update-aliases ${RELEASE_VERSION} stable
mike retitle --push ${RELEASE_VERSION} "${RELEASE_VERSION} (stable)"
run: ./scripts/ci/release_stable_docs.sh
chocolatey:
needs: [initialize]
@@ -94,9 +84,6 @@ jobs:
- name: Validate release version
run: |
echo "Release version: ${{ env.RELEASE_VERSION }}"
- name: Trigger choco
run: |
curl -X POST https://api.github.com/repos/ClementTsang/choco-bottom/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-u ${{ secrets.BOTTOM_PACKAGE_DEPLOYMENT }} \
--data '{ "event_type": "update", "client_payload": { "version": "'"$RELEASE_VERSION"'" } }'
run: ./scripts/ci/release_choco.sh
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
git config --global user.name ${GIT_USER}
git config --global user.email ${GIT_EMAIL}
echo Name: $(git config --get user.name)
echo Email: $(git config --get user.email)
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
python "./scripts/windows/choco/choco_packager.py" \
"./release/bottom_x86_64-pc-windows-msvc.zip" \
${{ env.RELEASE_VERSION }} \
"./scripts/windows/choco/bottom.nuspec.template" \
"./scripts/windows/choco/chocolateyinstall.ps1.template" \
"bottom.nuspec" \
"tools/chocolateyinstall.ps1" \
"tools/"
zip -r choco.zip "bottom.nuspec" "tools"
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
curl -X POST https://api.github.com/repos/ClementTsang/choco-bottom/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-u ${{ secrets.BOTTOM_PACKAGE_DEPLOYMENT }} \
--data '{ "event_type": "update", "client_payload": { "version": "'"$RELEASE_VERSION"'" } }'
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
cd docs
OLD_STABLE_VERSION=$(mike list stable | grep -Po '([0-9]+.[0-9]+.[0-9]+)' | head -n1)
echo ${OLD_STABLE_VERSION}
mike retitle --push stable ${OLD_STABLE_VERSION}
mike deploy --push --update-aliases ${RELEASE_VERSION} stable
mike retitle --push ${RELEASE_VERSION} "${RELEASE_VERSION} (stable)"