···11-# This file was autogenerated by dist: https://axodotdev.github.io/cargo-dist
22-#
33-# Copyright 2022-2024, axodotdev
44-# SPDX-License-Identifier: MIT or Apache-2.0
55-#
66-# CI that:
77-#
88-# * checks for a Git Tag that looks like a release
99-# * builds artifacts with dist (archives, installers, hashes)
1010-# * uploads those artifacts to temporary workflow zip
1111-# * on success, uploads the artifacts to a GitHub Release
1212-#
1313-# Note that the GitHub Release will be created with a generated
1414-# title/body based on your changelogs.
1515-1616-name: Release
1717-permissions:
1818- "contents": "write"
1919-2020-# This task will run whenever you push a git tag that looks like a version
2121-# like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc.
2222-# Various formats will be parsed into a VERSION and an optional PACKAGE_NAME, where
2323-# PACKAGE_NAME must be the name of a Cargo package in your workspace, and VERSION
2424-# must be a Cargo-style SemVer Version (must have at least major.minor.patch).
2525-#
2626-# If PACKAGE_NAME is specified, then the announcement will be for that
2727-# package (erroring out if it doesn't have the given version or isn't dist-able).
2828-#
2929-# If PACKAGE_NAME isn't specified, then the announcement will be for all
3030-# (dist-able) packages in the workspace with that version (this mode is
3131-# intended for workspaces with only one dist-able package, or with all dist-able
3232-# packages versioned/released in lockstep).
3333-#
3434-# If you push multiple tags at once, separate instances of this workflow will
3535-# spin up, creating an independent announcement for each one. However, GitHub
3636-# will hard limit this to 3 tags per commit, as it will assume more tags is a
3737-# mistake.
3838-#
3939-# If there's a prerelease-style suffix to the version, then the release(s)
4040-# will be marked as a prerelease.
4141-on:
4242- pull_request:
4343- push:
4444- tags:
4545- - '**[0-9]+.[0-9]+.[0-9]+*'
4646-4747-jobs:
4848- # Run 'dist plan' (or host) to determine what tasks we need to do
4949- plan:
5050- runs-on: "ubuntu-22.04"
5151- outputs:
5252- val: ${{ steps.plan.outputs.manifest }}
5353- tag: ${{ !github.event.pull_request && github.ref_name || '' }}
5454- tag-flag: ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }}
5555- publishing: ${{ !github.event.pull_request }}
5656- env:
5757- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5858- steps:
5959- - uses: actions/checkout@v4
6060- with:
6161- persist-credentials: false
6262- submodules: recursive
6363- - name: Install dist
6464- # we specify bash to get pipefail; it guards against the `curl` command
6565- # failing. otherwise `sh` won't catch that `curl` returned non-0
6666- shell: bash
6767- run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.30.0/cargo-dist-installer.sh | sh"
6868- - name: Cache dist
6969- uses: actions/upload-artifact@v4
7070- with:
7171- name: cargo-dist-cache
7272- path: ~/.cargo/bin/dist
7373- # sure would be cool if github gave us proper conditionals...
7474- # so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
7575- # functionality based on whether this is a pull_request, and whether it's from a fork.
7676- # (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
7777- # but also really annoying to build CI around when it needs secrets to work right.)
7878- - id: plan
7979- run: |
8080- dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
8181- echo "dist ran successfully"
8282- cat plan-dist-manifest.json
8383- echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
8484- - name: "Upload dist-manifest.json"
8585- uses: actions/upload-artifact@v4
8686- with:
8787- name: artifacts-plan-dist-manifest
8888- path: plan-dist-manifest.json
8989-9090- # Build and packages all the platform-specific things
9191- build-local-artifacts:
9292- name: build-local-artifacts (${{ join(matrix.targets, ', ') }})
9393- # Let the initial task tell us to not run (currently very blunt)
9494- needs:
9595- - plan
9696- if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
9797- strategy:
9898- fail-fast: false
9999- # Target platforms/runners are computed by dist in create-release.
100100- # Each member of the matrix has the following arguments:
101101- #
102102- # - runner: the github runner
103103- # - dist-args: cli flags to pass to dist
104104- # - install-dist: expression to run to install dist on the runner
105105- #
106106- # Typically there will be:
107107- # - 1 "global" task that builds universal installers
108108- # - N "local" tasks that build each platform's binaries and platform-specific installers
109109- matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
110110- runs-on: ${{ matrix.runner }}
111111- container: ${{ matrix.container && matrix.container.image || null }}
112112- env:
113113- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114114- BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
115115- steps:
116116- - name: enable windows longpaths
117117- run: |
118118- git config --global core.longpaths true
119119- - uses: actions/checkout@v4
120120- with:
121121- persist-credentials: false
122122- submodules: recursive
123123- - name: Install Rust non-interactively if not already installed
124124- if: ${{ matrix.container }}
125125- run: |
126126- if ! command -v cargo > /dev/null 2>&1; then
127127- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
128128- echo "$HOME/.cargo/bin" >> $GITHUB_PATH
129129- fi
130130- - name: Install dist
131131- run: ${{ matrix.install_dist.run }}
132132- # Get the dist-manifest
133133- - name: Fetch local artifacts
134134- uses: actions/download-artifact@v4
135135- with:
136136- pattern: artifacts-*
137137- path: target/distrib/
138138- merge-multiple: true
139139- - name: Install dependencies
140140- run: |
141141- ${{ matrix.packages_install }}
142142- - name: Build artifacts
143143- run: |
144144- # Actually do builds and make zips and whatnot
145145- dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
146146- echo "dist ran successfully"
147147- - id: cargo-dist
148148- name: Post-build
149149- # We force bash here just because github makes it really hard to get values up
150150- # to "real" actions without writing to env-vars, and writing to env-vars has
151151- # inconsistent syntax between shell and powershell.
152152- shell: bash
153153- run: |
154154- # Parse out what we just built and upload it to scratch storage
155155- echo "paths<<EOF" >> "$GITHUB_OUTPUT"
156156- dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT"
157157- echo "EOF" >> "$GITHUB_OUTPUT"
158158-159159- cp dist-manifest.json "$BUILD_MANIFEST_NAME"
160160- - name: "Upload artifacts"
161161- uses: actions/upload-artifact@v4
162162- with:
163163- name: artifacts-build-local-${{ join(matrix.targets, '_') }}
164164- path: |
165165- ${{ steps.cargo-dist.outputs.paths }}
166166- ${{ env.BUILD_MANIFEST_NAME }}
167167-168168- # Build and package all the platform-agnostic(ish) things
169169- build-global-artifacts:
170170- needs:
171171- - plan
172172- - build-local-artifacts
173173- runs-on: "ubuntu-22.04"
174174- env:
175175- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
176176- BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json
177177- steps:
178178- - uses: actions/checkout@v4
179179- with:
180180- persist-credentials: false
181181- submodules: recursive
182182- - name: Install cached dist
183183- uses: actions/download-artifact@v4
184184- with:
185185- name: cargo-dist-cache
186186- path: ~/.cargo/bin/
187187- - run: chmod +x ~/.cargo/bin/dist
188188- # Get all the local artifacts for the global tasks to use (for e.g. checksums)
189189- - name: Fetch local artifacts
190190- uses: actions/download-artifact@v4
191191- with:
192192- pattern: artifacts-*
193193- path: target/distrib/
194194- merge-multiple: true
195195- - id: cargo-dist
196196- shell: bash
197197- run: |
198198- dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
199199- echo "dist ran successfully"
200200-201201- # Parse out what we just built and upload it to scratch storage
202202- echo "paths<<EOF" >> "$GITHUB_OUTPUT"
203203- jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
204204- echo "EOF" >> "$GITHUB_OUTPUT"
205205-206206- cp dist-manifest.json "$BUILD_MANIFEST_NAME"
207207- - name: "Upload artifacts"
208208- uses: actions/upload-artifact@v4
209209- with:
210210- name: artifacts-build-global
211211- path: |
212212- ${{ steps.cargo-dist.outputs.paths }}
213213- ${{ env.BUILD_MANIFEST_NAME }}
214214- # Determines if we should publish/announce
215215- host:
216216- needs:
217217- - plan
218218- - build-local-artifacts
219219- - build-global-artifacts
220220- # Only run if we're "publishing", and only if local and global didn't fail (skipped is fine)
221221- if: ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }}
222222- env:
223223- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
224224- runs-on: "ubuntu-22.04"
225225- outputs:
226226- val: ${{ steps.host.outputs.manifest }}
227227- steps:
228228- - uses: actions/checkout@v4
229229- with:
230230- persist-credentials: false
231231- submodules: recursive
232232- - name: Install cached dist
233233- uses: actions/download-artifact@v4
234234- with:
235235- name: cargo-dist-cache
236236- path: ~/.cargo/bin/
237237- - run: chmod +x ~/.cargo/bin/dist
238238- # Fetch artifacts from scratch-storage
239239- - name: Fetch artifacts
240240- uses: actions/download-artifact@v4
241241- with:
242242- pattern: artifacts-*
243243- path: target/distrib/
244244- merge-multiple: true
245245- - id: host
246246- shell: bash
247247- run: |
248248- dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
249249- echo "artifacts uploaded and released successfully"
250250- cat dist-manifest.json
251251- echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
252252- - name: "Upload dist-manifest.json"
253253- uses: actions/upload-artifact@v4
254254- with:
255255- # Overwrite the previous copy
256256- name: artifacts-dist-manifest
257257- path: dist-manifest.json
258258- # Create a GitHub Release while uploading all files to it
259259- - name: "Download GitHub Artifacts"
260260- uses: actions/download-artifact@v4
261261- with:
262262- pattern: artifacts-*
263263- path: artifacts
264264- merge-multiple: true
265265- - name: Cleanup
266266- run: |
267267- # Remove the granular manifests
268268- rm -f artifacts/*-dist-manifest.json
269269- - name: Create GitHub Release
270270- env:
271271- PRERELEASE_FLAG: "${{ fromJson(steps.host.outputs.manifest).announcement_is_prerelease && '--prerelease' || '' }}"
272272- ANNOUNCEMENT_TITLE: "${{ fromJson(steps.host.outputs.manifest).announcement_title }}"
273273- ANNOUNCEMENT_BODY: "${{ fromJson(steps.host.outputs.manifest).announcement_github_body }}"
274274- RELEASE_COMMIT: "${{ github.sha }}"
275275- run: |
276276- # Write and read notes from a file to avoid quoting breaking things
277277- echo "$ANNOUNCEMENT_BODY" > $RUNNER_TEMP/notes.txt
278278-279279- gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*
280280-281281- announce:
282282- needs:
283283- - plan
284284- - host
285285- # use "always() && ..." to allow us to wait for all publish jobs while
286286- # still allowing individual publish jobs to skip themselves (for prereleases).
287287- # "host" however must run to completion, no skipping allowed!
288288- if: ${{ always() && needs.host.result == 'success' }}
289289- runs-on: "ubuntu-22.04"
290290- env:
291291- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
292292- steps:
293293- - uses: actions/checkout@v4
294294- with:
295295- persist-credentials: false
296296- submodules: recursive
+5
crates/jacquard-lexicon/Cargo.toml
···46464747[dev-dependencies]
4848tempfile = { version = "3.23.0" }
4949+5050+[package.metadata.binstall]
5151+pkg-url = "https://github.com/rsform/jacquard/releases/download/v{ version }/{ name }_{ target }_v{ version }{ archive-suffix }"
5252+bin-dir = "{ name }_{ target }_v{ version }/{ bin }{ binary-ext }"
5353+pkg-fmt = "txz"
-17
dist-workspace.toml
···11-[workspace]
22-members = ["cargo:."]
33-44-# Config for 'dist'
55-[dist]
66-# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
77-cargo-dist-version = "0.30.0"
88-# CI backends to support
99-ci = "github"
1010-# The installers to generate for each app
1111-installers = ["shell"]
1212-# Target platforms to build apps for (Rust target-triple syntax)
1313-targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "aarch64-pc-windows-msvc", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"]
1414-# Path that installers should place binaries in
1515-install-path = "CARGO_HOME"
1616-# Whether to install an updater program
1717-install-updater = false