ci: remove template expansion in code contexts (#1434)
This commit is contained in:
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
@@ -13,6 +13,10 @@ env:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
fmt:
|
fmt:
|
||||||
name: Rustfmt
|
name: Rustfmt
|
||||||
@@ -126,6 +130,9 @@ jobs:
|
|||||||
- target: x86_64-pc-windows-msvc
|
- target: x86_64-pc-windows-msvc
|
||||||
target_name: Windows
|
target_name: Windows
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
|
env:
|
||||||
|
cargo_cmd: ${{ matrix.use_cross == true && 'cross' || 'cargo' }}
|
||||||
|
matrix_target: ${{ matrix.target }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v5.0.0
|
uses: actions/checkout@v5.0.0
|
||||||
@@ -139,17 +146,20 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup cross
|
- name: Setup cross
|
||||||
if: matrix.use_cross == true
|
if: matrix.use_cross == true
|
||||||
run: curl -fL --retry 3 https://github.com/cross-rs/cross/releases/download/v${{ env.CROSS_VER }}/cross-x86_64-unknown-linux-musl.tar.gz | tar vxz -C /usr/local/bin
|
run: |
|
||||||
|
curl -fL --retry 3 "https://github.com/cross-rs/cross/releases/download/v${CROSS_VER}/cross-x86_64-unknown-linux-musl.tar.gz" | tar vxz -C /usr/local/bin
|
||||||
|
|
||||||
- name: Run cargo/cross check
|
- name: Run cargo/cross check
|
||||||
run: ${{ matrix.use_cross == true && 'cross' || 'cargo' }} check --locked --target ${{ matrix.target }}
|
run: |
|
||||||
|
"${cargo_cmd}" check --locked --target "${matrix_target}"
|
||||||
|
|
||||||
- name: Run cargo/cross clippy
|
- name: Run cargo/cross clippy
|
||||||
run: |
|
run: |
|
||||||
rustup component add clippy
|
rustup component add clippy
|
||||||
${{ matrix.use_cross == true && 'cross' || 'cargo' }} clippy --locked --target ${{ matrix.target }} --all-features -- -D warnings
|
"${cargo_cmd}" clippy --locked --target "${matrix_target}" --all-features -- -D warnings
|
||||||
|
|
||||||
- name: Run cargo test
|
- name: Run cargo test
|
||||||
# ONLY run test with cargo
|
# ONLY run test with cargo
|
||||||
if: matrix.use_cross == false
|
if: matrix.use_cross == false
|
||||||
run: cargo test --locked --target ${{ matrix.target }}
|
run: |
|
||||||
|
cargo test --locked --target "${matrix_target}"
|
||||||
|
|||||||
45
.github/workflows/create_release_assets.yml
vendored
45
.github/workflows/create_release_assets.yml
vendored
@@ -26,6 +26,8 @@ jobs:
|
|||||||
# https://github.com/topgrade-rs/topgrade/issues/1095
|
# https://github.com/topgrade-rs/topgrade/issues/1095
|
||||||
platform: [ ubuntu-22.04, macos-latest, macos-15-intel, windows-latest ]
|
platform: [ ubuntu-22.04, macos-latest, macos-15-intel, windows-latest ]
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
|
env:
|
||||||
|
tag: ${{ github.event.client_payload.tag }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5.0.0
|
- uses: actions/checkout@v5.0.0
|
||||||
with:
|
with:
|
||||||
@@ -83,7 +85,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cargo install default-target
|
cargo install default-target
|
||||||
mkdir -p assets
|
mkdir -p assets
|
||||||
FILENAME=topgrade-${{ github.event.client_payload.tag }}-$(default-target)
|
FILENAME=topgrade-${tag}-$(default-target)
|
||||||
mv target/release/topgrade assets
|
mv target/release/topgrade assets
|
||||||
cd assets
|
cd assets
|
||||||
tar --format=ustar -czf $FILENAME.tar.gz topgrade
|
tar --format=ustar -czf $FILENAME.tar.gz topgrade
|
||||||
@@ -114,7 +116,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cargo install default-target
|
cargo install default-target
|
||||||
mkdir assets
|
mkdir assets
|
||||||
FILENAME=topgrade-${{ github.event.client_payload.tag }}-$(default-target)
|
FILENAME=topgrade-${tag}-$(default-target)
|
||||||
mv target/release/topgrade.exe assets/topgrade.exe
|
mv target/release/topgrade.exe assets/topgrade.exe
|
||||||
cd assets
|
cd assets
|
||||||
powershell Compress-Archive -Path * -Destination ${FILENAME}.zip
|
powershell Compress-Archive -Path * -Destination ${FILENAME}.zip
|
||||||
@@ -124,8 +126,8 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Upload assets
|
- name: Upload assets
|
||||||
run:
|
run: |
|
||||||
gh release upload "${{ github.event.client_payload.tag }}" assets/*
|
gh release upload "${tag}" assets/*
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
@@ -158,6 +160,9 @@ jobs:
|
|||||||
# Even though this is cross-compiled, it links to the libc6-<arch>-cross installed on the host
|
# Even though this is cross-compiled, it links to the libc6-<arch>-cross installed on the host
|
||||||
# (see the apt-get install calls below)
|
# (see the apt-get install calls below)
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
env:
|
||||||
|
matrix_target: ${{ matrix.target }}
|
||||||
|
tag: ${{ github.event.client_payload.tag }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5.0.0
|
- uses: actions/checkout@v5.0.0
|
||||||
with:
|
with:
|
||||||
@@ -184,20 +189,20 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: install targets
|
- name: install targets
|
||||||
run: rustup target add ${{ matrix.target }}
|
run: rustup target add "${matrix_target}"
|
||||||
|
|
||||||
- name: install cross
|
- name: install cross
|
||||||
# Install from source to fix `ld: cannot find -lgeom` for freebsd build
|
# Install from source to fix `ld: cannot find -lgeom` for freebsd build
|
||||||
run: cargo +stable install --git https://github.com/cross-rs/cross cross
|
run: cargo +stable install --git https://github.com/cross-rs/cross cross
|
||||||
|
|
||||||
- name: Run clippy
|
- name: Run clippy
|
||||||
run: cross clippy --all-targets --locked --target ${{matrix.target}} -- -D warnings
|
run: cross clippy --all-targets --locked --target "${matrix_target}" -- -D warnings
|
||||||
|
|
||||||
- name: Run clippy (All features)
|
- name: Run clippy (All features)
|
||||||
run: cross clippy --locked --all-features --target ${{matrix.target}} -- -D warnings
|
run: cross clippy --locked --all-features --target "${matrix_target}" -- -D warnings
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cross test --target ${{matrix.target}}
|
run: cross test --target "${matrix_target}"
|
||||||
# Running tests on FreeBSD is impossible; see https://github.com/cross-rs/cross/wiki/FAQ#running-bsd-tests
|
# Running tests on FreeBSD is impossible; see https://github.com/cross-rs/cross/wiki/FAQ#running-bsd-tests
|
||||||
# Not that this is *NOT* the same as the original issue with `ld: cannot find -lgeom`, but a new issue:
|
# Not that this is *NOT* the same as the original issue with `ld: cannot find -lgeom`, but a new issue:
|
||||||
# error: test failed, to rerun pass `--lib`
|
# error: test failed, to rerun pass `--lib`
|
||||||
@@ -235,15 +240,15 @@ jobs:
|
|||||||
"$BIN" --gen-completion zsh > "$DEPLOY_DIR/_topgrade"
|
"$BIN" --gen-completion zsh > "$DEPLOY_DIR/_topgrade"
|
||||||
|
|
||||||
- name: Build in Release profile with all features enabled
|
- name: Build in Release profile with all features enabled
|
||||||
run: cross build --release --all-features --target ${{matrix.target}}
|
run: cross build --release --all-features --target "${matrix_target}"
|
||||||
|
|
||||||
- name: Rename Release
|
- name: Rename Release
|
||||||
run: |
|
run: |
|
||||||
mkdir -p assets
|
mkdir -p assets
|
||||||
FILENAME=topgrade-${{ github.event.client_payload.tag }}-${{matrix.target}}
|
FILENAME=topgrade-${tag}-${matrix_target}
|
||||||
mv target/${{matrix.target}}/release/topgrade assets
|
mv "target/${matrix_target}/release/topgrade" assets
|
||||||
cd assets
|
cd assets
|
||||||
tar --format=ustar -czf $FILENAME.tar.gz topgrade
|
tar --format=ustar -czf "$FILENAME.tar.gz" topgrade
|
||||||
rm topgrade
|
rm topgrade
|
||||||
ls .
|
ls .
|
||||||
|
|
||||||
@@ -252,23 +257,23 @@ jobs:
|
|||||||
# because we don't want the auto-update feature,
|
# because we don't want the auto-update feature,
|
||||||
# then build the new binary without auto-updating.
|
# then build the new binary without auto-updating.
|
||||||
run: |
|
run: |
|
||||||
rm -rf target/${{matrix.target}}
|
rm -rf "target/${matrix_target}"
|
||||||
cross build --release --target ${{matrix.target}}
|
cross build --release --target "${matrix_target}"
|
||||||
cargo deb --target=${{matrix.target}} --no-build --no-strip
|
cargo deb --target="${matrix_target}" --no-build --no-strip
|
||||||
if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'armv7-unknown-linux-gnueabihf' }}
|
if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'armv7-unknown-linux-gnueabihf' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Move Debian-based system package
|
- name: Move Debian-based system package
|
||||||
run: |
|
run: |
|
||||||
mkdir -p assets
|
mkdir -p assets
|
||||||
mv target/${{matrix.target}}/debian/*.deb assets
|
mv "target/${matrix_target}/debian/*.deb" assets
|
||||||
if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'armv7-unknown-linux-gnueabihf' }}
|
if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'armv7-unknown-linux-gnueabihf' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
|
||||||
- name: Upload assets
|
- name: Upload assets
|
||||||
run:
|
run:
|
||||||
gh release upload "${{ github.event.client_payload.tag }}" assets/*
|
gh release upload "${tag}" assets/*
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
@@ -280,11 +285,13 @@ jobs:
|
|||||||
triggers:
|
triggers:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [ native_build, cross_build ]
|
needs: [ native_build, cross_build ]
|
||||||
|
env:
|
||||||
|
tag: ${{ github.event.client_payload.tag }}
|
||||||
steps:
|
steps:
|
||||||
- name: Trigger workflows
|
- name: Trigger workflows
|
||||||
run: |
|
run: |
|
||||||
gh api repos/${{ github.repository }}/dispatches \
|
gh api "repos/${GITHUB_REPOSITORY}/dispatches" \
|
||||||
-f "event_type=release-assets-built" \
|
-f "event_type=release-assets-built" \
|
||||||
-F "client_payload[tag]=${{ github.event.client_payload.tag }}"
|
-F "client_payload[tag]=${tag}"
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
9
.github/workflows/release-plz.yml
vendored
9
.github/workflows/release-plz.yml
vendored
@@ -33,12 +33,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Trigger workflows
|
- name: Trigger workflows
|
||||||
if: steps.release-plz.outputs.releases_created == 'true'
|
if: steps.release-plz.outputs.releases_created == 'true'
|
||||||
run: |
|
|
||||||
gh api repos/${{ github.repository }}/dispatches \
|
|
||||||
-f "event_type=release-created" \
|
|
||||||
-F "client_payload[tag]=${{ fromJSON(steps.release-plz.outputs.releases)[0].tag }}"
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
tag: ${{ fromJSON(steps.release-plz.outputs.releases)[0].tag }}
|
||||||
|
run: |
|
||||||
|
gh api "repos/${GITHUB_REPOSITORY}/dispatches" \
|
||||||
|
-f "event_type=release-created" \
|
||||||
|
-F "client_payload[tag]=${tag}"
|
||||||
|
|
||||||
# Create a PR with the new versions and changelog, preparing the next release.
|
# Create a PR with the new versions and changelog, preparing the next release.
|
||||||
release-plz-pr:
|
release-plz-pr:
|
||||||
|
|||||||
3
.github/workflows/release_to_aur.yml
vendored
3
.github/workflows/release_to_aur.yml
vendored
@@ -13,9 +13,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Determine version
|
- name: Determine version
|
||||||
id: determine_version
|
id: determine_version
|
||||||
|
env:
|
||||||
|
tag: ${{ github.event.client_payload.tag }}
|
||||||
run: |
|
run: |
|
||||||
# tag should be something like "v16.0.4", remove the prefix v here
|
# tag should be something like "v16.0.4", remove the prefix v here
|
||||||
tag="${{ github.event.client_payload.tag }}"
|
|
||||||
echo "version=${tag#v}" >> $GITHUB_OUTPUT
|
echo "version=${tag#v}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Publish source AUR package
|
- name: Publish source AUR package
|
||||||
|
|||||||
Reference in New Issue
Block a user