Fix release profile override on Windows

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2024-06-10 23:00:56 +10:00
parent a4cff680b0
commit 4fb93aa9d2
No known key found for this signature in database
GPG key ID: 76D1E687CA3C4928

View file

@ -27,17 +27,28 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- { o: macos-14, t: x86_64-apple-darwin, r: true } - { o: macos-14, t: x86_64-apple-darwin, r: true }
- { o: macos-14, t: x86_64h-apple-darwin, } - { o: macos-14, t: x86_64h-apple-darwin }
- { o: macos-14, t: aarch64-apple-darwin } - { o: macos-14, t: aarch64-apple-darwin }
- { o: ubuntu-latest, t: x86_64-unknown-linux-gnu, g: 2.17, r: true, c: true } - {
- { o: ubuntu-latest, t: armv7-unknown-linux-gnueabihf, g: 2.17, c: true } o: ubuntu-latest,
- { o: ubuntu-latest, t: aarch64-unknown-linux-gnu, g: 2.17, c: true } t: x86_64-unknown-linux-gnu,
- { o: ubuntu-latest, t: x86_64-unknown-linux-musl, r: true, c: true } g: 2.17,
- { o: ubuntu-latest, t: armv7-unknown-linux-musleabihf, c: true } r: true,
- { o: ubuntu-latest, t: aarch64-unknown-linux-musl, c: true } c: true,
- { o: windows-latest, t: x86_64-pc-windows-msvc, r: true } }
- { o: windows-latest, t: aarch64-pc-windows-msvc } - {
o: ubuntu-latest,
t: armv7-unknown-linux-gnueabihf,
g: 2.17,
c: true,
}
- { o: ubuntu-latest, t: aarch64-unknown-linux-gnu, g: 2.17, c: true }
- { o: ubuntu-latest, t: x86_64-unknown-linux-musl, r: true, c: true }
- { o: ubuntu-latest, t: armv7-unknown-linux-musleabihf, c: true }
- { o: ubuntu-latest, t: aarch64-unknown-linux-musl, c: true }
- { o: windows-latest, t: x86_64-pc-windows-msvc, r: true }
- { o: windows-latest, t: aarch64-pc-windows-msvc }
name: ${{ matrix.t }} name: ${{ matrix.t }}
runs-on: ${{ matrix.o }} runs-on: ${{ matrix.o }}
@ -52,73 +63,75 @@ jobs:
JUST_ENABLE_H3: true JUST_ENABLE_H3: true
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Override release profile lto settings - name: Override release profile lto settings
if: inputs.CARGO_PROFILE_RELEASE_LTO if: inputs.CARGO_PROFILE_RELEASE_LTO
run: echo "CARGO_PROFILE_RELEASE_LTO=${{ inputs.CARGO_PROFILE_RELEASE_LTO }}" >> "$GITHUB_ENV" run: echo "CARGO_PROFILE_RELEASE_LTO=${{ inputs.CARGO_PROFILE_RELEASE_LTO }}" >> "$GITHUB_ENV"
shell: bash
- name: Override release profile codegen-units settings - name: Override release profile codegen-units settings
if: inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS if: inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS
run: echo "CARGO_PROFILE_RELEASE_CODEGEN_UNITS=${{ inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS }}" >> "$GITHUB_ENV" run: echo "CARGO_PROFILE_RELEASE_CODEGEN_UNITS=${{ inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS }}" >> "$GITHUB_ENV"
shell: bash
- uses: ./.github/actions/just-setup - uses: ./.github/actions/just-setup
with: with:
tools: cargo-auditable,rsign2,rage tools: cargo-auditable,rsign2,rage
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: just toolchain rust-src - run: just toolchain rust-src
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v4
with: with:
name: minisign.pub name: minisign.pub
- run: just package - run: just package
- if: runner.os == 'Windows' - if: runner.os == 'Windows'
run: Get-ChildItem packages/ run: Get-ChildItem packages/
- if: runner.os != 'Windows' - if: runner.os != 'Windows'
run: ls -shal packages/ run: ls -shal packages/
- name: Ensure release binary is runnable - name: Ensure release binary is runnable
if: "matrix.r" if: "matrix.r"
run: just e2e-tests run: just e2e-tests
env: env:
GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN }}
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v4
with: with:
name: minisign.key.age name: minisign.key.age
- name: Sign package - name: Sign package
env: env:
AGE_KEY_SECRET: ${{ secrets.AGE_KEY_SECRET }} AGE_KEY_SECRET: ${{ secrets.AGE_KEY_SECRET }}
shell: bash shell: bash
run: .github/scripts/ephemeral-sign.sh packages/cargo-binstall-* run: .github/scripts/ephemeral-sign.sh packages/cargo-binstall-*
- if: fromJSON(inputs.publish).is-release == 'true' - if: fromJSON(inputs.publish).is-release == 'true'
name: Upload to release name: Upload to release
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
release_name: v${{ fromJSON(inputs.publish).version }} release_name: v${{ fromJSON(inputs.publish).version }}
tag: v${{ fromJSON(inputs.publish).version }} tag: v${{ fromJSON(inputs.publish).version }}
body: ${{ fromJSON(inputs.publish).notes }} body: ${{ fromJSON(inputs.publish).notes }}
file: packages/cargo-binstall-* file: packages/cargo-binstall-*
file_glob: true file_glob: true
prerelease: true prerelease: true
- if: "fromJSON(inputs.publish).is-release != 'true' || runner.os == 'macOS'" - if: "fromJSON(inputs.publish).is-release != 'true' || runner.os == 'macOS'"
name: Upload artifact name: Upload artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: ${{ matrix.t }} name: ${{ matrix.t }}
path: packages/cargo-binstall-* path: packages/cargo-binstall-*
retention-days: 1 retention-days: 1
- name: Upload timings - name: Upload timings
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: ${{ matrix.t }}-cargo-timings name: ${{ matrix.t }}-cargo-timings
path: target/cargo-timings path: target/cargo-timings
retention-days: 1 retention-days: 1
lipo: lipo:
needs: build needs: build
@ -130,58 +143,58 @@ jobs:
JUST_FOR_RELEASE: true JUST_FOR_RELEASE: true
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: taiki-e/install-action@v2 - uses: taiki-e/install-action@v2
with: with:
tool: just,rsign2,rage tool: just,rsign2,rage
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v4
with: with:
name: x86_64h-apple-darwin name: x86_64h-apple-darwin
path: packages/ path: packages/
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v4
with: with:
name: x86_64-apple-darwin name: x86_64-apple-darwin
path: packages/ path: packages/
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v4
with: with:
name: aarch64-apple-darwin name: aarch64-apple-darwin
path: packages/ path: packages/
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v4
with: with:
name: minisign.pub name: minisign.pub
- run: ls -shalr packages/ - run: ls -shalr packages/
- run: just repackage-lipo - run: just repackage-lipo
- run: ls -shal packages/ - run: ls -shal packages/
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v4
with: with:
name: minisign.key.age name: minisign.key.age
- env: - env:
AGE_KEY_SECRET: ${{ secrets.AGE_KEY_SECRET }} AGE_KEY_SECRET: ${{ secrets.AGE_KEY_SECRET }}
shell: bash shell: bash
run: .github/scripts/ephemeral-sign.sh packages/cargo-binstall-universal-* run: .github/scripts/ephemeral-sign.sh packages/cargo-binstall-universal-*
- if: fromJSON(inputs.publish).is-release == 'true' - if: fromJSON(inputs.publish).is-release == 'true'
name: Upload to release name: Upload to release
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ fromJSON(inputs.publish).version }} tag: v${{ fromJSON(inputs.publish).version }}
release_name: v${{ fromJSON(inputs.publish).version }} release_name: v${{ fromJSON(inputs.publish).version }}
body: ${{ fromJSON(inputs.publish).notes }} body: ${{ fromJSON(inputs.publish).notes }}
file: packages/cargo-binstall-universal-* file: packages/cargo-binstall-universal-*
file_glob: true file_glob: true
overwrite: true overwrite: true
prerelease: true prerelease: true
- if: fromJSON(inputs.publish).is-release != 'true' - if: fromJSON(inputs.publish).is-release != 'true'
name: Upload artifact name: Upload artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: universal-apple-darwin name: universal-apple-darwin
path: packages/cargo-binstall-universal-* path: packages/cargo-binstall-universal-*
retention-days: 1 retention-days: 1