mirror of
https://github.com/atuinsh/atuin.git
synced 2025-06-25 12:21:55 +02:00
chore: update to cargo-dist 0.16, enable attestations (#2156)
This commit is contained in:
parent
88633b8994
commit
4dd76d84ed
30
.github/workflows/release.yml
vendored
30
.github/workflows/release.yml
vendored
@ -15,6 +15,8 @@ name: Release
|
|||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
attestations: write
|
||||||
|
|
||||||
# This task will run whenever you push a git tag that looks like a version
|
# This task will run whenever you push a git tag that looks like a version
|
||||||
# like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc.
|
# like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc.
|
||||||
@ -62,7 +64,7 @@ jobs:
|
|||||||
# we specify bash to get pipefail; it guards against the `curl` command
|
# we specify bash to get pipefail; it guards against the `curl` command
|
||||||
# failing. otherwise `sh` won't catch that `curl` returned non-0
|
# failing. otherwise `sh` won't catch that `curl` returned non-0
|
||||||
shell: bash
|
shell: bash
|
||||||
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.15.0/cargo-dist-installer.sh | sh"
|
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.16.0/cargo-dist-installer.sh | sh"
|
||||||
# sure would be cool if github gave us proper conditionals...
|
# sure would be cool if github gave us proper conditionals...
|
||||||
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
|
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
|
||||||
# functionality based on whether this is a pull_request, and whether it's from a fork.
|
# functionality based on whether this is a pull_request, and whether it's from a fork.
|
||||||
@ -114,6 +116,7 @@ jobs:
|
|||||||
- uses: swatinem/rust-cache@v2
|
- uses: swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
key: ${{ join(matrix.targets, '-') }}
|
key: ${{ join(matrix.targets, '-') }}
|
||||||
|
cache-provider: ${{ matrix.cache_provider }}
|
||||||
- name: Install cargo-dist
|
- name: Install cargo-dist
|
||||||
run: ${{ matrix.install_dist }}
|
run: ${{ matrix.install_dist }}
|
||||||
# Get the dist-manifest
|
# Get the dist-manifest
|
||||||
@ -131,6 +134,10 @@ jobs:
|
|||||||
# Actually do builds and make zips and whatnot
|
# Actually do builds and make zips and whatnot
|
||||||
cargo dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
|
cargo dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
|
||||||
echo "cargo dist ran successfully"
|
echo "cargo dist ran successfully"
|
||||||
|
- name: Attest
|
||||||
|
uses: actions/attest-build-provenance@v1
|
||||||
|
with:
|
||||||
|
subject-path: "target/distrib/*${{ join(matrix.targets, ', ') }}*"
|
||||||
- id: cargo-dist
|
- id: cargo-dist
|
||||||
name: Post-build
|
name: Post-build
|
||||||
# We force bash here just because github makes it really hard to get values up
|
# We force bash here just because github makes it really hard to get values up
|
||||||
@ -167,7 +174,7 @@ jobs:
|
|||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Install cargo-dist
|
- name: Install cargo-dist
|
||||||
shell: bash
|
shell: bash
|
||||||
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.15.0/cargo-dist-installer.sh | sh"
|
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.16.0/cargo-dist-installer.sh | sh"
|
||||||
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
|
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
|
||||||
- name: Fetch local artifacts
|
- name: Fetch local artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@ -212,7 +219,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Install cargo-dist
|
- name: Install cargo-dist
|
||||||
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.15.0/cargo-dist-installer.sh | sh"
|
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.16.0/cargo-dist-installer.sh | sh"
|
||||||
# Fetch artifacts from scratch-storage
|
# Fetch artifacts from scratch-storage
|
||||||
- name: Fetch artifacts
|
- name: Fetch artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@ -262,10 +269,13 @@ jobs:
|
|||||||
# Remove the granular manifests
|
# Remove the granular manifests
|
||||||
rm -f artifacts/*-dist-manifest.json
|
rm -f artifacts/*-dist-manifest.json
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
uses: ncipollo/release-action@v1
|
env:
|
||||||
with:
|
PRERELEASE_FLAG: "${{ fromJson(needs.host.outputs.val).announcement_is_prerelease && '--prerelease' || '' }}"
|
||||||
tag: ${{ needs.plan.outputs.tag }}
|
ANNOUNCEMENT_TITLE: "${{ fromJson(needs.host.outputs.val).announcement_title }}"
|
||||||
name: ${{ fromJson(needs.host.outputs.val).announcement_title }}
|
ANNOUNCEMENT_BODY: "${{ fromJson(needs.host.outputs.val).announcement_github_body }}"
|
||||||
body: ${{ fromJson(needs.host.outputs.val).announcement_github_body }}
|
run: |
|
||||||
prerelease: ${{ fromJson(needs.host.outputs.val).announcement_is_prerelease }}
|
# Write and read notes from a file to avoid quoting breaking things
|
||||||
artifacts: "artifacts/*"
|
echo "$ANNOUNCEMENT_BODY" > $RUNNER_TEMP/notes.txt
|
||||||
|
|
||||||
|
gh release create "${{ needs.plan.outputs.tag }}" --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" $PRERELEASE_FLAG
|
||||||
|
gh release upload "${{ needs.plan.outputs.tag }}" artifacts/*
|
||||||
|
14
Cargo.toml
14
Cargo.toml
@ -58,28 +58,24 @@ features = ["runtime-tokio-rustls", "time", "postgres", "uuid"]
|
|||||||
|
|
||||||
# Config for 'cargo dist'
|
# Config for 'cargo dist'
|
||||||
[workspace.metadata.dist]
|
[workspace.metadata.dist]
|
||||||
|
# Path that installers should place binaries in
|
||||||
install-path = "~/.atuin/bin"
|
install-path = "~/.atuin/bin"
|
||||||
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
|
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
|
||||||
cargo-dist-version = "0.15.0"
|
cargo-dist-version = "0.16.0"
|
||||||
# CI backends to support
|
# CI backends to support
|
||||||
ci = "github"
|
ci = "github"
|
||||||
# The installers to generate for each app
|
# The installers to generate for each app
|
||||||
installers = ["shell"]
|
installers = ["shell"]
|
||||||
# Target platforms to build apps for (Rust target-triple syntax)
|
# Target platforms to build apps for (Rust target-triple syntax)
|
||||||
targets = [
|
targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "aarch64-unknown-linux-musl", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl"]
|
||||||
"aarch64-apple-darwin",
|
|
||||||
"aarch64-unknown-linux-gnu",
|
|
||||||
"aarch64-unknown-linux-musl",
|
|
||||||
"x86_64-apple-darwin",
|
|
||||||
"x86_64-unknown-linux-gnu",
|
|
||||||
"x86_64-unknown-linux-musl",
|
|
||||||
]
|
|
||||||
# Publish jobs to run in CI
|
# Publish jobs to run in CI
|
||||||
pr-run-mode = "plan"
|
pr-run-mode = "plan"
|
||||||
# Whether to install an updater program
|
# Whether to install an updater program
|
||||||
install-updater = true
|
install-updater = true
|
||||||
# The archive format to use for non-windows builds (defaults .tar.xz)
|
# The archive format to use for non-windows builds (defaults .tar.xz)
|
||||||
unix-archive = ".tar.gz"
|
unix-archive = ".tar.gz"
|
||||||
|
# Whether to enable GitHub Attestations
|
||||||
|
github-attestations = true
|
||||||
|
|
||||||
# The profile that 'cargo dist' will build with
|
# The profile that 'cargo dist' will build with
|
||||||
[profile.dist]
|
[profile.dist]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user